mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	add commitgraph support global default true when git version >= 2.18 (#7313)
This commit is contained in:
		@@ -114,6 +114,18 @@ func Init() error {
 | 
				
			|||||||
		GitExecutable, "config", "--global", "core.quotepath", "false"); err != nil {
 | 
							GitExecutable, "config", "--global", "core.quotepath", "false"); err != nil {
 | 
				
			||||||
		return fmt.Errorf("Failed to execute 'git config --global core.quotepath false': %s", stderr)
 | 
							return fmt.Errorf("Failed to execute 'git config --global core.quotepath false': %s", stderr)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if version.Compare(gitVersion, "2.18", ">=") {
 | 
				
			||||||
 | 
							if _, stderr, err := process.GetManager().Exec("git.Init(git config --global core.commitGraph true)",
 | 
				
			||||||
 | 
								GitExecutable, "config", "--global", "core.commitGraph", "true"); err != nil {
 | 
				
			||||||
 | 
								return fmt.Errorf("Failed to execute 'git config --global core.commitGraph true': %s", stderr)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if _, stderr, err := process.GetManager().Exec("git.Init(git config --global gc.writeCommitGraph true)",
 | 
				
			||||||
 | 
								GitExecutable, "config", "--global", "gc.writeCommitGraph", "true"); err != nil {
 | 
				
			||||||
 | 
								return fmt.Errorf("Failed to execute 'git config --global gc.writeCommitGraph true': %s", stderr)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user