chore: fix git commit "rev-list" (#38069)

Fix the copied & pasted messy code, fix #38067

Now, "limit=-1" means "no limit"
This commit is contained in:
wxiaoguang
2026-06-11 18:08:55 +00:00
committed by GitHub
parent 5a24438698
commit d3d092f65d
20 changed files with 145 additions and 203 deletions
+3 -3
View File
@@ -22,7 +22,7 @@ func getAuthorSignatureSquash(ctx *mergeContext) (*git.Signature, error) {
return nil, err
}
// Try to get an signature from the same user in one of the commits, as the
// Try to get a signature from the same user in one of the commits, as the
// poster email might be private or commits might have a different signature
// than the primary email address of the poster.
gitRepo, err := git.OpenRepository(ctx, ctx.tmpBasePath)
@@ -32,9 +32,9 @@ func getAuthorSignatureSquash(ctx *mergeContext) (*git.Signature, error) {
}
defer gitRepo.Close()
commits, err := gitRepo.CommitsBetweenIDs(tmpRepoTrackingBranch, "HEAD")
commits, err := gitRepo.CommitsBetween(git.RefNameFromBranch(tmpRepoTrackingBranch), git.RefNameHead, -1)
if err != nil {
log.Error("%-v Unable to get commits between: %s %s: %v", ctx.pr, "HEAD", tmpRepoTrackingBranch, err)
log.Error("%-v Unable to get commits between: head and tracking branch: %v", ctx.pr, err)
return nil, err
}