Skip to content

Commit 3be1289

Browse files
6543AbdulrhmnGhanem
authored andcommitted
1 parent 4d3e6f1 commit 3be1289

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/repository/repo.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User,
9393
return repo, fmt.Errorf("Failed to remove %s: %v", wikiPath, err)
9494
}
9595

96-
if err = git.Clone(ctx, wikiRemotePath, wikiPath, git.CloneRepoOptions{
96+
if err := git.Clone(ctx, wikiRemotePath, wikiPath, git.CloneRepoOptions{
9797
Mirror: true,
9898
Quiet: true,
9999
Timeout: migrateTimeout,
@@ -104,11 +104,12 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User,
104104
if err := util.RemoveAll(wikiPath); err != nil {
105105
return repo, fmt.Errorf("Failed to remove %s: %v", wikiPath, err)
106106
}
107+
} else {
108+
if err := git.WriteCommitGraph(ctx, wikiPath); err != nil {
109+
return repo, err
110+
}
107111
}
108112
}
109-
if err := git.WriteCommitGraph(ctx, wikiPath); err != nil {
110-
return repo, err
111-
}
112113
}
113114

114115
if repo.OwnerID == u.ID {

0 commit comments

Comments
 (0)