diff options
author | 6543 <6543@obermui.de> | 2022-04-30 14:50:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-30 20:50:56 +0800 |
commit | 8d34c2fab9a6816d0738925e1c8d1c6aa721cd1f (patch) | |
tree | a27b4d70fee7f915f384ae391df6f60a4158f67b /modules/repository | |
parent | bf7258be9ca32f0cbfd74b87c4cdf846e3860d14 (diff) | |
download | gitea-8d34c2fab9a6816d0738925e1c8d1c6aa721cd1f.tar.gz gitea-8d34c2fab9a6816d0738925e1c8d1c6aa721cd1f.zip |
fix #19545 (#19563)
Diffstat (limited to 'modules/repository')
-rw-r--r-- | modules/repository/repo.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/repository/repo.go b/modules/repository/repo.go index 0dffa322d0..30ca6fdff8 100644 --- a/modules/repository/repo.go +++ b/modules/repository/repo.go @@ -93,7 +93,7 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User, return repo, fmt.Errorf("Failed to remove %s: %v", wikiPath, err) } - if err = git.Clone(ctx, wikiRemotePath, wikiPath, git.CloneRepoOptions{ + if err := git.Clone(ctx, wikiRemotePath, wikiPath, git.CloneRepoOptions{ Mirror: true, Quiet: true, Timeout: migrateTimeout, @@ -104,11 +104,12 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User, if err := util.RemoveAll(wikiPath); err != nil { return repo, fmt.Errorf("Failed to remove %s: %v", wikiPath, err) } + } else { + if err := git.WriteCommitGraph(ctx, wikiPath); err != nil { + return repo, err + } } } - if err := git.WriteCommitGraph(ctx, wikiPath); err != nil { - return repo, err - } } if repo.OwnerID == u.ID { |