mirror of https://github.com/gogs/gogs.git
config: show Git version in admin panel
parent
0958fe5a4e
commit
9b72661767
|
@ -1050,6 +1050,7 @@ config.offline_mode = Offline Mode
|
|||
config.disable_router_log = Disable Router Log
|
||||
config.run_user = Run User
|
||||
config.run_mode = Run Mode
|
||||
config.git_version = Git Version
|
||||
config.repo_root_path = Repository Root Path
|
||||
config.static_file_root_path = Static File Root Path
|
||||
config.log_file_root_path = Log File Root Path
|
||||
|
|
|
@ -115,13 +115,14 @@ func NewRepoContext() {
|
|||
}
|
||||
|
||||
// Check Git version.
|
||||
gitVer, err := git.BinVersion()
|
||||
var err error
|
||||
setting.Git.Version, err = git.BinVersion()
|
||||
if err != nil {
|
||||
log.Fatal(4, "Fail to get Git version: %v", err)
|
||||
}
|
||||
|
||||
log.Info("Git Version: %s", gitVer)
|
||||
if version.Compare("1.7.1", gitVer, ">") {
|
||||
log.Info("Git Version: %s", setting.Git.Version)
|
||||
if version.Compare("1.7.1", setting.Git.Version, ">") {
|
||||
log.Fatal(4, "Gogs requires Git version greater or equal to 1.7.1")
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -210,6 +210,7 @@ var (
|
|||
|
||||
// Git settings
|
||||
Git struct {
|
||||
Version string `ini:"-"`
|
||||
DisableDiffHighlight bool
|
||||
MaxGitDiffLines int
|
||||
MaxGitDiffLineCharacters int
|
||||
|
|
|
@ -199,6 +199,7 @@ func Config(ctx *context.Context) {
|
|||
ctx.Data["DisableRouterLog"] = setting.DisableRouterLog
|
||||
ctx.Data["RunUser"] = setting.RunUser
|
||||
ctx.Data["RunMode"] = strings.Title(macaron.Env)
|
||||
ctx.Data["GitVersion"] = setting.Git.Version
|
||||
ctx.Data["RepoRootPath"] = setting.RepoRootPath
|
||||
ctx.Data["StaticRootPath"] = setting.StaticRootPath
|
||||
ctx.Data["LogRootPath"] = setting.LogRootPath
|
||||
|
|
|
@ -32,6 +32,11 @@
|
|||
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<dt>{{.i18n.Tr "admin.config.git_version"}}</dt>
|
||||
<dd>{{.GitVersion}}</dd>
|
||||
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<dt>{{.i18n.Tr "admin.config.repo_root_path"}}</dt>
|
||||
<dd>{{.RepoRootPath}}</dd>
|
||||
<dt>{{.i18n.Tr "admin.config.static_file_root_path"}}</dt>
|
||||
|
|
Loading…
Reference in New Issue