diff options
author | Bwko <bouwko@gmail.com> | 2016-12-03 22:31:54 +0100 |
---|---|---|
committer | Bwko <bouwko@gmail.com> | 2016-12-03 22:31:54 +0100 |
commit | 0118b275b66d8aa54975410513fe14df2d1dc521 (patch) | |
tree | 68affff5358369a275f3a0a1a8c70a55ca6f6fe2 /models/pull.go | |
parent | c8f300b2cdc6f00ba1aeb98c51a534f18474b895 (diff) | |
download | gitea-0118b275b66d8aa54975410513fe14df2d1dc521.tar.gz gitea-0118b275b66d8aa54975410513fe14df2d1dc521.zip |
Fix for #320
Suppress the error when we're removing a file that may not exist
Diffstat (limited to 'models/pull.go')
-rw-r--r-- | models/pull.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/models/pull.go b/models/pull.go index daed84bf22..5b54058b8d 100644 --- a/models/pull.go +++ b/models/pull.go @@ -712,9 +712,8 @@ func (pr *PullRequest) PushToBaseRepo() (err error) { // Remove head in case there is a conflict. file := path.Join(pr.BaseRepo.RepoPath(), headFile) - if err := os.Remove(file); err != nil { - return fmt.Errorf("Fail to remove dir %s: %v", path.Join(pr.BaseRepo.RepoPath(), headFile), err) - } + _ = os.Remove(file) + if err = git.Push(headRepoPath, tmpRemoteName, fmt.Sprintf("%s:%s", pr.HeadBranch, headFile)); err != nil { return fmt.Errorf("Push: %v", err) } |