diff options
author | zeripath | 2022-06-17 21:19:21 +0100 |
---|---|---|
committer | GitHub | 2022-06-17 21:19:21 +0100 |
commit | 1e9ad8eb2112a6354cf1fc75f5d8034062cbe89f (patch) | |
tree | cba57d7e8bd71c61b10b7e08b70c06b0ad4edd12 | |
parent | ea9997a9ddaa5c1ae3a3f062dddfeb92321f2338 (diff) |
Write Commit-Graphs in RepositoryDumper (#20004)
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>
-rw-r--r-- | services/migrations/dump.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/services/migrations/dump.go b/services/migrations/dump.go index ad04756d4..21d03b333 100644 --- a/services/migrations/dump.go +++ b/services/migrations/dump.go @@ -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() @@ -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 } } } |