fix wiki bugs (#1294)

This commit is contained in:
Lunny Xiao 2017-03-20 21:36:19 +08:00 committed by GitHub
parent dbabc35e71
commit bd8fe49076
2 changed files with 21 additions and 5 deletions

View file

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