diff options
author | Sandro Santilli <strk@kbt.io> | 2018-01-19 07:53:45 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-01-19 08:53:45 +0200 |
commit | 05ab747054adf8617fc2e365bfeaed775cb10746 (patch) | |
tree | 9f5ef60729173316448ccd91f5ff3ab679c8c7de | |
parent | ca306985d35f295fb2a2f8a54661731462426281 (diff) | |
download | gitea-05ab747054adf8617fc2e365bfeaed775cb10746.tar.gz gitea-05ab747054adf8617fc2e365bfeaed775cb10746.zip |
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
-rw-r--r-- | models/pull.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/models/pull.go b/models/pull.go index 5c54a2268a..45fe852e9f 100644 --- a/models/pull.go +++ b/models/pull.go @@ -1010,6 +1010,7 @@ func (pr *PullRequest) PushToBaseRepo() (err error) { if err = git.Push(headRepoPath, git.PushOptions{ Remote: tmpRemoteName, Branch: fmt.Sprintf("%s:%s", pr.HeadBranch, headFile), + Force: true, }); err != nil { return fmt.Errorf("Push: %v", err) } |