1
0
Fork 0
forked from forgejo/forgejo
Suppress the error when we're removing a file that may not exist
This commit is contained in:
Bwko 2016-12-03 22:31:54 +01:00
parent c8f300b2cd
commit 0118b275b6
2 changed files with 3 additions and 6 deletions

View file

@ -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)
}