mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -159,6 +159,9 @@ func (g *RepositoryDumper) CreateRepo(repo *base.Repository, opts base.MigrateOp
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return fmt.Errorf("Clone: %v", err)
 | 
							return fmt.Errorf("Clone: %v", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if err := git.WriteCommitGraph(g.ctx, repoPath); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if opts.Wiki {
 | 
						if opts.Wiki {
 | 
				
			||||||
		wikiPath := g.wikiPath()
 | 
							wikiPath := g.wikiPath()
 | 
				
			||||||
@@ -179,6 +182,8 @@ func (g *RepositoryDumper) CreateRepo(repo *base.Repository, opts base.MigrateOp
 | 
				
			|||||||
				if err := os.RemoveAll(wikiPath); err != nil {
 | 
									if err := os.RemoveAll(wikiPath); err != nil {
 | 
				
			||||||
					return fmt.Errorf("Failed to remove %s: %v", wikiPath, err)
 | 
										return fmt.Errorf("Failed to remove %s: %v", wikiPath, err)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
								} else if err := git.WriteCommitGraph(g.ctx, wikiPath); err != nil {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user