Skip to content

Commit 05ab747

Browse files
strklafriks
authored andcommitted
Force-push to base repo's ref/pull/#/head (#3393)
* Force-push to base repo's ref/pull/#/head Fixes force-pushing to pull request branches, otherwise failing with: [...gitea/models/pull.go:1022 AddTestPullRequestTask()] [E] PushToBaseRepo: Push: exit status 1 - To /path/to/gitea-repositories/org/repo.git ! [rejected] issue-fix -> refs/pull/20/head (non-fast-forward) * format
1 parent ca30698 commit 05ab747

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

models/pull.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,7 @@ func (pr *PullRequest) PushToBaseRepo() (err error) {
10101010
if err = git.Push(headRepoPath, git.PushOptions{
10111011
Remote: tmpRemoteName,
10121012
Branch: fmt.Sprintf("%s:%s", pr.HeadBranch, headFile),
1013+
Force: true,
10131014
}); err != nil {
10141015
return fmt.Errorf("Push: %v", err)
10151016
}

0 commit comments

Comments
 (0)