summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hook.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/hook.go b/cmd/hook.go
index f38fd8831b..624569cdfa 100644
--- a/cmd/hook.go
+++ b/cmd/hook.go
@@ -376,7 +376,9 @@ Gitea or set your environment appropriately.`, "")
oldCommitIDs[count] = string(fields[0])
newCommitIDs[count] = string(fields[1])
refFullNames[count] = git.RefName(fields[2])
- if refFullNames[count] == git.BranchPrefix+"master" && newCommitIDs[count] != git.EmptySHA && count == total {
+
+ commitID, _ := git.IDFromString(newCommitIDs[count])
+ if refFullNames[count] == git.BranchPrefix+"master" && !commitID.IsZero() && count == total {
masterPushed = true
}
count++
@@ -669,7 +671,8 @@ Gitea or set your environment appropriately.`, "")
if err != nil {
return err
}
- if rs.OldOID != git.EmptySHA {
+ commitID, _ := git.IDFromString(rs.OldOID)
+ if !commitID.IsZero() {
err = writeDataPktLine(ctx, os.Stdout, []byte("option old-oid "+rs.OldOID))
if err != nil {
return err