Skip to content

Commit 10d73d3

Browse files
authored
resolved #485: when migrate empty wiki repo, then ignore (#544)
1 parent fbb424c commit 10d73d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

models/repo.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,6 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
691691

692692
wikiRemotePath := wikiRemoteURL(opts.RemoteAddr)
693693
if len(wikiRemotePath) > 0 {
694-
695694
if err := os.RemoveAll(wikiPath); err != nil {
696695
return repo, fmt.Errorf("Fail to remove %s: %v", wikiPath, err)
697696
}
@@ -700,8 +699,12 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
700699
Mirror: true,
701700
Quiet: true,
702701
Timeout: migrateTimeout,
702+
Branch: "master",
703703
}); err != nil {
704-
log.Info("Clone wiki: %v", err)
704+
log.Warn("Clone wiki: %v", err)
705+
if err := os.RemoveAll(wikiPath); err != nil {
706+
return repo, fmt.Errorf("Fail to remove %s: %v", wikiPath, err)
707+
}
705708
}
706709
}
707710

0 commit comments

Comments
 (0)