Skip to content

Commit

Permalink
resolved #485: when migrate empty wiki repo, then ignore (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Dec 31, 2016
1 parent fbb424c commit 10d73d3
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 10d73d3

Please sign in to comment.