summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorMura Li <typeless@users.noreply.github.com>2019-07-07 15:26:56 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-07-07 03:26:56 -0400
commitf88aa1d21572beafc5a22db0c9712751f47fc0ac (patch)
treeabeb23e8a3b141e5156f7ec99222e968c8d5a73d /modules/setting
parent8d9d6aa903baf3662fa31bceb489291564a873d1 (diff)
downloadgitea-f88aa1d21572beafc5a22db0c9712751f47fc0ac.tar.gz
gitea-f88aa1d21572beafc5a22db0c9712751f47fc0ac.zip
Support git.PATH entry in app.ini (#6772)
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/git.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/setting/git.go b/modules/setting/git.go
index 4163f1039d..8495be8836 100644
--- a/modules/setting/git.go
+++ b/modules/setting/git.go
@@ -16,6 +16,7 @@ import (
var (
// Git settings
Git = struct {
+ Path string
DisableDiffHighlight bool
MaxGitDiffLines int
MaxGitDiffLineCharacters int
@@ -59,6 +60,9 @@ func newGit() {
if err := Cfg.Section("git").MapTo(&Git); err != nil {
log.Fatal("Failed to map Git settings: %v", err)
}
+ if err := git.SetExecutablePath(Git.Path); err != nil {
+ log.Fatal("Failed to initialize Git settings", err)
+ }
git.DefaultCommandExecutionTimeout = time.Duration(Git.Timeout.Default) * time.Second
binVersion, err := git.BinVersion()