mirror of
https://github.com/gogs/gogs.git
synced 2025-05-30 03:03:02 +00:00
migrate: fix unexpected removal of repository when wiki is detected
This commit is contained in:
parent
60aca9ea18
commit
d21dc0da78
@ -655,14 +655,14 @@ func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
|
|||||||
|
|
||||||
wikiRemotePath := wikiRemoteURL(opts.RemoteAddr)
|
wikiRemotePath := wikiRemoteURL(opts.RemoteAddr)
|
||||||
if len(wikiRemotePath) > 0 {
|
if len(wikiRemotePath) > 0 {
|
||||||
RemoveAllWithNotice("Repository wiki path erase before creation", repoPath)
|
RemoveAllWithNotice("Repository wiki path erase before creation", wikiPath)
|
||||||
if err = git.Clone(wikiRemotePath, wikiPath, git.CloneRepoOptions{
|
if err = git.Clone(wikiRemotePath, wikiPath, git.CloneRepoOptions{
|
||||||
Mirror: true,
|
Mirror: true,
|
||||||
Quiet: true,
|
Quiet: true,
|
||||||
Timeout: migrateTimeout,
|
Timeout: migrateTimeout,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
log.Trace("Fail to clone wiki: %v", err)
|
log.Trace("Fail to clone wiki: %v", err)
|
||||||
RemoveAllWithNotice("Delete repository wiki for initialization failure", repoPath)
|
RemoveAllWithNotice("Delete repository wiki for initialization failure", wikiPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user