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-12 02:08:55 +08:00
committed by GitHub
parent 5a24438698
commit d3d092f65d
20 changed files with 145 additions and 203 deletions
+6 -6
View File
@@ -210,7 +210,7 @@ func SyncReleasesWithTags(ctx context.Context, repo *repo_model.Repository, gitR
syncResults = append(syncResults, &SyncResult{
RefName: git.RefNameFromTag(tag.Name),
OldCommitID: "",
NewCommitID: tag.Object.String(),
NewCommitID: tag.Object.RefName(),
})
}
for _, deleteID := range deletes {
@@ -220,20 +220,20 @@ func SyncReleasesWithTags(ctx context.Context, repo *repo_model.Repository, gitR
}
syncResults = append(syncResults, &SyncResult{
RefName: git.RefNameFromTag(release.TagName),
OldCommitID: release.Sha1,
OldCommitID: git.RefNameFromCommit(release.Sha1),
NewCommitID: "",
})
}
for _, tag := range updates {
release := dbReleasesByTag[tag.Name]
oldSha := ""
var oldCommitID git.RefName
if release != nil {
oldSha = release.Sha1
oldCommitID = git.RefNameFromCommit(release.Sha1)
}
syncResults = append(syncResults, &SyncResult{
RefName: git.RefNameFromTag(tag.Name),
OldCommitID: oldSha,
NewCommitID: tag.Object.String(),
OldCommitID: oldCommitID,
NewCommitID: tag.Object.RefName(),
})
}
//