Skip to content

Commit ff50ea9

Browse files
CaiCandongwxiaoguang
authored andcommitted
add some comments
Co-authored-by: wxiaoguang <[email protected]>
1 parent b4f1c36 commit ff50ea9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

routers/private/hook_verification.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ func verifyCommits(oldCommitID, newCommitID string, repo *git.Repository, env []
3030

3131
var command *git.Command
3232
if oldCommitID == git.EmptySHA {
33+
// When creating a new branch, the oldCommitID is empty, by using "newCommitID --not --all":
34+
// List commits that are reachable by following the newCommitID, exclude "all" existing heads/tags commits
35+
// So, it only lists the new commits received, doesn't list the commits already present in the receiving repository
3336
command = git.NewCommand(repo.Ctx, "rev-list").AddDynamicArguments(newCommitID).AddArguments("--not", "--all")
3437
} else {
3538
command = git.NewCommand(repo.Ctx, "rev-list").AddDynamicArguments(oldCommitID + "..." + newCommitID)

0 commit comments

Comments
 (0)