Fix push multiple branches error with tests (#31151)

(cherry picked from commit 5c1b550e00e9460078e00c41a32d206b260ef482)

Conflicts:
	tests/integration/git_push_test.go
	trivial context conflict because of
	2ac3dcbd43 test: hook post-receive for sha256 repos
This commit is contained in:
Lunny Xiao 2024-05-29 14:43:02 +08:00 committed by Earl Warren
parent b4887fcd37
commit 62448bfb93
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 54 additions and 1 deletions

View file

@ -296,7 +296,7 @@ func SyncBranchesToDB(ctx context.Context, repoID, pusherID int64, branchNames,
if _, err := git_model.UpdateBranch(ctx, repoID, pusherID, branchName, commit); err != nil {
return fmt.Errorf("git_model.UpdateBranch %d:%s failed: %v", repoID, branchName, err)
}
return nil
continue
}
// if database have branches but not this branch, it means this is a new branch