Skip to content

Commit

Permalink
Write Commit-Graphs in RepositoryDumper (go-gitea#20004)
Browse files Browse the repository at this point in the history
When migrating git repositories we should ensure that the commit-graph is written.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
  • Loading branch information
2 people authored and AbdulrhmnGhanem committed Aug 23, 2022
1 parent 1404130 commit 92b6f19
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions services/migrations/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ func (g *RepositoryDumper) CreateRepo(repo *base.Repository, opts base.MigrateOp
if err != nil {
return fmt.Errorf("Clone: %v", err)
}
if err := git.WriteCommitGraph(g.ctx, repoPath); err != nil {
return err
}

if opts.Wiki {
wikiPath := g.wikiPath()
Expand All @@ -179,6 +182,8 @@ func (g *RepositoryDumper) CreateRepo(repo *base.Repository, opts base.MigrateOp
if err := os.RemoveAll(wikiPath); err != nil {
return fmt.Errorf("Failed to remove %s: %v", wikiPath, err)
}
} else if err := git.WriteCommitGraph(g.ctx, wikiPath); err != nil {
return err
}
}
}
Expand Down

0 comments on commit 92b6f19

Please sign in to comment.