Skip to content

Commit

Permalink
resolved go-gitea#485: when migrate empty wiki repo, then ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Dec 31, 2016
1 parent e8bac94 commit 8e414ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,6 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {

wikiRemotePath := wikiRemoteURL(opts.RemoteAddr)
if len(wikiRemotePath) > 0 {

if err := os.RemoveAll(wikiPath); err != nil {
return repo, fmt.Errorf("Fail to remove %s: %v", wikiPath, err)
}
Expand All @@ -700,8 +699,12 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
Mirror: true,
Quiet: true,
Timeout: migrateTimeout,
Branch: "master",
}); err != nil {
log.Info("Clone wiki: %v", err)
log.Warn("Clone wiki: %v", err)
if err := os.RemoveAll(wikiPath); err != nil {
return repo, fmt.Errorf("Fail to remove %s: %v", wikiPath, err)
}
}
}

Expand Down

0 comments on commit 8e414ab

Please sign in to comment.