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
This commit is contained in:
parent
ca306985d3
commit
05ab747054
|
@ -1010,6 +1010,7 @@ func (pr *PullRequest) PushToBaseRepo() (err error) {
|
||||||
if err = git.Push(headRepoPath, git.PushOptions{
|
if err = git.Push(headRepoPath, git.PushOptions{
|
||||||
Remote: tmpRemoteName,
|
Remote: tmpRemoteName,
|
||||||
Branch: fmt.Sprintf("%s:%s", pr.HeadBranch, headFile),
|
Branch: fmt.Sprintf("%s:%s", pr.HeadBranch, headFile),
|
||||||
|
Force: true,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return fmt.Errorf("Push: %v", err)
|
return fmt.Errorf("Push: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user