Skip to content

Commit 1e9ad8e

Browse files
zeripathdelvh
andauthored
Write Commit-Graphs in RepositoryDumper (#20004)
When migrating git repositories we should ensure that the commit-graph is written. Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: delvh <[email protected]>
1 parent ea9997a commit 1e9ad8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

services/migrations/dump.go

+5
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ func (g *RepositoryDumper) CreateRepo(repo *base.Repository, opts base.MigrateOp
159159
if err != nil {
160160
return fmt.Errorf("Clone: %v", err)
161161
}
162+
if err := git.WriteCommitGraph(g.ctx, repoPath); err != nil {
163+
return err
164+
}
162165

163166
if opts.Wiki {
164167
wikiPath := g.wikiPath()
@@ -179,6 +182,8 @@ func (g *RepositoryDumper) CreateRepo(repo *base.Repository, opts base.MigrateOp
179182
if err := os.RemoveAll(wikiPath); err != nil {
180183
return fmt.Errorf("Failed to remove %s: %v", wikiPath, err)
181184
}
185+
} else if err := git.WriteCommitGraph(g.ctx, wikiPath); err != nil {
186+
return err
182187
}
183188
}
184189
}

0 commit comments

Comments
 (0)