fix(migrations): preserve SHA-256 pull request commit IDs (#39343)

* Fixes #39339

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
breken
2026-09-19 05:41:41 -07:00
committed by GitHub
parent 2a3d047339
commit cc34c26172
17 changed files with 105 additions and 128 deletions
+2 -2
View File
@@ -203,8 +203,8 @@ func (repo *Repository) searchCommits(ctx context.Context, id ObjectID, opts Sea
// if there are any keywords (ie not committer:, author:, time:)
// then let's iterate over them
for _, v := range opts.Keywords {
// ignore anything not matching a valid sha pattern
if id.Type().IsValid(v) {
// ignore anything not matching a valid sha pattern (TODO: the legacy min-length is pretty small, is it right or fine?)
if IsStringValidObjectID(id.Type(), v, 4) {
// create new git log command with 1 commit limit
hashCmd := gitcmd.NewCommand("log", "-1", prettyLogFormat)
// add previous arguments except for --grep and --all