Merge pull request #345 from Bwko/fix_for_320

Fix for #320
This commit is contained in:
Andrey Nering 2016-12-03 20:06:05 -02:00 committed by GitHub
commit dc14d0c046
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)
}

View file

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