aboutsummaryrefslogtreecommitdiffstats
path: root/models/wiki.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/wiki.go')
-rw-r--r--models/wiki.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/models/wiki.go b/models/wiki.go
index 690da707c6..d864505d56 100644
--- a/models/wiki.go
+++ b/models/wiki.go
@@ -84,7 +84,11 @@ func (repo *Repository) LocalWikiPath() string {
func (repo *Repository) UpdateLocalWiki() error {
// Don't pass branch name here because it fails to clone and
// checkout to a specific branch when wiki is an empty repository.
- return UpdateLocalCopyBranch(repo.WikiPath(), repo.LocalWikiPath(), "")
+ var branch = ""
+ if com.IsExist(repo.LocalWikiPath()) {
+ branch = "master"
+ }
+ return UpdateLocalCopyBranch(repo.WikiPath(), repo.LocalWikiPath(), branch)
}
func discardLocalWikiChanges(localPath string) error {