diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-03-20 21:36:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-20 21:36:19 +0800 |
commit | bd8fe49076e0f880fbb923822f2247b57f9799e9 (patch) | |
tree | 4b9d66c20d828444142cf2e1c4866e9f9032afcc /models/wiki.go | |
parent | dbabc35e7157de9482482d97ebfbce3194a44bda (diff) | |
download | gitea-bd8fe49076e0f880fbb923822f2247b57f9799e9.tar.gz gitea-bd8fe49076e0f880fbb923822f2247b57f9799e9.zip |
fix wiki bugs (#1294)
Diffstat (limited to 'models/wiki.go')
-rw-r--r-- | models/wiki.go | 6 |
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 { |