summaryrefslogtreecommitdiffstats
path: root/models/wiki.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/wiki.go')
-rw-r--r--models/wiki.go17
1 files changed, 2 insertions, 15 deletions
diff --git a/models/wiki.go b/models/wiki.go
index 7a286f4ba3..24cd6aca21 100644
--- a/models/wiki.go
+++ b/models/wiki.go
@@ -76,24 +76,11 @@ func (repo *Repository) LocalWikiPath() string {
// UpdateLocalWiki makes sure the local copy of repository wiki is up-to-date.
func (repo *Repository) UpdateLocalWiki() error {
- return updateLocalCopy(repo.WikiPath(), repo.LocalWikiPath(), "")
+ return UpdateLocalCopyBranch(repo.WikiPath(), repo.LocalWikiPath(), "master")
}
-// discardLocalWikiChanges discards local commits make sure
-// it is even to remote branch when local copy exists.
func discardLocalWikiChanges(localPath string) error {
- if !com.IsExist(localPath) {
- return nil
- }
- // No need to check if nothing in the repository.
- if !git.IsBranchExist(localPath, "master") {
- return nil
- }
-
- if err := git.ResetHEAD(localPath, true, "origin/master"); err != nil {
- return fmt.Errorf("ResetHEAD: %v", err)
- }
- return nil
+ return discardLocalRepoBranchChanges(localPath, "master")
}
// updateWikiPage adds new page to repository wiki.