diff --git a/models/wiki.go b/models/wiki.go index 24cd6aca2..2f57eadda 100644 --- a/models/wiki.go +++ b/models/wiki.go @@ -76,7 +76,9 @@ func (repo *Repository) LocalWikiPath() string { // UpdateLocalWiki makes sure the local copy of repository wiki is up-to-date. func (repo *Repository) UpdateLocalWiki() error { - return UpdateLocalCopyBranch(repo.WikiPath(), repo.LocalWikiPath(), "master") + // 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(), "") } func discardLocalWikiChanges(localPath string) error {