Skip to content

Commit

Permalink
Migration: only write commit-graph if wiki clone was successfull (#19563
Browse files Browse the repository at this point in the history
) (#19568)
  • Loading branch information
6543 committed Apr 30, 2022
1 parent 7c0bf06 commit 755d8e2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/repository/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User,
return repo, fmt.Errorf("Failed to remove %s: %v", wikiPath, err)
}

if err = git.CloneWithContext(ctx, wikiRemotePath, wikiPath, git.CloneRepoOptions{
if err := git.CloneWithContext(ctx, wikiRemotePath, wikiPath, git.CloneRepoOptions{
Mirror: true,
Quiet: true,
Timeout: migrateTimeout,
Expand All @@ -103,11 +103,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 {
Expand Down

0 comments on commit 755d8e2

Please sign in to comment.