summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Nering <andrey.nering@gmail.com>2016-12-03 20:06:05 -0200
committerGitHub <noreply@github.com>2016-12-03 20:06:05 -0200
commitdc14d0c046eaf426a76d1de44e6d4e4f2e292562 (patch)
tree68affff5358369a275f3a0a1a8c70a55ca6f6fe2
parentc8f300b2cdc6f00ba1aeb98c51a534f18474b895 (diff)
parent0118b275b66d8aa54975410513fe14df2d1dc521 (diff)
downloadgitea-dc14d0c046eaf426a76d1de44e6d4e4f2e292562.tar.gz
gitea-dc14d0c046eaf426a76d1de44e6d4e4f2e292562.zip
Merge pull request #345 from Bwko/fix_for_320
Fix for #320
-rw-r--r--models/pull.go5
-rw-r--r--models/wiki.go4
2 files changed, 3 insertions, 6 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)
}
diff --git a/models/wiki.go b/models/wiki.go
index 890e62b0cd..89da4571db 100644
--- a/models/wiki.go
+++ b/models/wiki.go
@@ -125,9 +125,7 @@ func (repo *Repository) updateWikiPage(doer *User, oldTitle, title, content, mes
// So we want to make sure the symlink is removed before write anything.
// The new file we created will be in normal text format.
- if err := os.Remove(filename); err != nil {
- return fmt.Errorf("Fail to remove %s: %v", filename, err)
- }
+ _ = os.Remove(filename)
if err = ioutil.WriteFile(filename, []byte(content), 0666); err != nil {
return fmt.Errorf("WriteFile: %v", err)