fix(pull): sign the commit when updating a branch by merge#38441
Open
eyupcanakman wants to merge 1 commit into
Open
fix(pull): sign the commit when updating a branch by merge#38441eyupcanakman wants to merge 1 commit into
eyupcanakman wants to merge 1 commit into
Conversation
`Update()` builds a fake reverse PR to switch head and base, and it has no `Index`, so `pr.GetGitHeadRefName()` resolves `refs/pull/0/head`. Since go-gitea#36186 `SignMerge` looks that ref up in the base repository instead of the temporary merge repo. That lookup fails. The caller dropped the error, so `sign` stayed false. Pass both sides of the merge to `SignMerge` as refs and evaluate them in the temp repo, where `base` and `tracking` always exist. Fixes go-gitea#38066 Assisted-by: Claude Code:claude-opus-4-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updating a branch by merge produced an unsigned commit even when merges are configured to be signed. Update by rebase was unaffected.
Update()builds a fake reverse PR to switch head and base, and it has noIndex, sopr.GetGitHeadRefName()resolvesrefs/pull/0/head. Since #36186SignMergelooks that ref up in the base repository instead of the temporary merge repo. That lookup fails. The caller dropped the error, sosignstayed false.Sync fork goes through the same fake-PR path.
Pass both sides of the merge to
SignMergeas refs and evaluate them in the temp repo, wherebaseandtrackingalways exist.Tests cover a signed and an unsigned update by merge.
Fixes #38066
Assisted-by: Claude Code:claude-opus-4-8