mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 22:17:20 +00:00
Refactor models.NewRepoContext to extract git related codes to modules/git (#6941)
* refactor models.NewRepoContext to extract git related codes to modules/git * fix imports * refactor
This commit is contained in:
@ -16,7 +16,6 @@ import (
|
||||
var (
|
||||
// Git settings
|
||||
Git = struct {
|
||||
Version string `ini:"-"`
|
||||
DisableDiffHighlight bool
|
||||
MaxGitDiffLines int
|
||||
MaxGitDiffLineCharacters int
|
||||
@ -65,6 +64,8 @@ func newGit() {
|
||||
log.Fatal("Error retrieving git version: %v", err)
|
||||
}
|
||||
|
||||
log.Info("Git Version: %s", binVersion)
|
||||
|
||||
if version.Compare(binVersion, "2.9", ">=") {
|
||||
// Explicitly disable credential helper, otherwise Git credentials might leak
|
||||
git.GlobalCommandArgs = append(git.GlobalCommandArgs, "-c", "credential.helper=")
|
||||
|
Reference in New Issue
Block a user