diff options
author | Unknwon <joe2010xtmf@163.com> | 2015-01-02 20:14:43 +0800 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2015-01-02 20:14:43 +0800 |
commit | c73e9057ae949bd0c0bf329b23d4e5da4ac154d0 (patch) | |
tree | 58a2d8bb67ad7b5846bbb2a17809dcef54fa6f79 /modules/setting | |
parent | 0b56272c130c88fc4441fb1cba04657fe73efc38 (diff) | |
download | gitea-c73e9057ae949bd0c0bf329b23d4e5da4ac154d0.tar.gz gitea-c73e9057ae949bd0c0bf329b23d4e5da4ac154d0.zip |
Optmize git-fsck options and fix #820
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index c4d3d3a6c2..bc9da3c63a 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -107,9 +107,15 @@ var ( SessionConfig session.Options // Git settings. - MaxGitDiffLines int - GitFsckArgs []string - GitGcArgs []string + Git struct { + MaxGitDiffLines int + GcArgs []string `delim:" "` + Fsck struct { + Enable bool + Interval int + Args []string `delim:" "` + } `ini:"git.fsck"` + } // I18n settings. Langs, Names []string @@ -174,6 +180,7 @@ func NewConfigContext() { } else { log.Warn("No custom 'conf/app.ini' found, please go to '/install'") } + Cfg.NameMapper = ini.AllCapsUnderscore LogRootPath = Cfg.Section("log").Key("ROOT_PATH").MustString(path.Join(workDir, "log")) @@ -291,10 +298,9 @@ func NewConfigContext() { } DisableGravatar = sec.Key("DISABLE_GRAVATAR").MustBool() - sec = Cfg.Section("git") - MaxGitDiffLines = sec.Key("MAX_GITDIFF_LINES").MustInt(10000) - GitFsckArgs = sec.Key("FSCK_ARGS").Strings(" ") - GitGcArgs = sec.Key("GC_ARGS").Strings(" ") + if err = Cfg.Section("git").MapTo(&Git); err != nil { + log.Fatal(4, "Fail to map Git settings: %v", err) + } Langs = Cfg.Section("i18n").Key("LANGS").Strings(",") Names = Cfg.Section("i18n").Key("NAMES").Strings(",") |