File tree Expand file tree Collapse file tree 7 files changed +14
-3
lines changed Expand file tree Collapse file tree 7 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -135,13 +135,14 @@ func NewRepoContext() {
135
135
}
136
136
137
137
// Check Git version.
138
- gitVer , err := git .BinVersion ()
138
+ var err error
139
+ setting .Git .Version , err = git .BinVersion ()
139
140
if err != nil {
140
141
log .Fatal (4 , "Failed to get Git version: %v" , err )
141
142
}
142
143
143
- log .Info ("Git Version: %s" , gitVer )
144
- if version .Compare ("1.7.1" , gitVer , ">" ) {
144
+ log .Info ("Git Version: %s" , setting . Git . Version )
145
+ if version .Compare ("1.7.1" , setting . Git . Version , ">" ) {
145
146
log .Fatal (4 , "Gitea requires Git version greater or equal to 1.7.1" )
146
147
}
147
148
Original file line number Diff line number Diff line change @@ -354,6 +354,7 @@ var (
354
354
355
355
// Git settings
356
356
Git = struct {
357
+ Version string `ini:"-"`
357
358
DisableDiffHighlight bool
358
359
MaxGitDiffLines int
359
360
MaxGitDiffLineCharacters int
Original file line number Diff line number Diff line change @@ -1117,6 +1117,7 @@ config.offline_mode = Offline Mode
1117
1117
config.disable_router_log = Disable Router Log
1118
1118
config.run_user = Run User
1119
1119
config.run_mode = Run Mode
1120
+ config.git_version = Git Version
1120
1121
config.repo_root_path = Repository Root Path
1121
1122
config.lfs_root_path = LFS Root Path
1122
1123
config.static_file_root_path = Static File Root Path
Original file line number Diff line number Diff line change @@ -1045,6 +1045,7 @@ config.offline_mode=離線模式
1045
1045
config.disable_router_log=關閉路由日誌
1046
1046
config.run_user=執行用戶
1047
1047
config.run_mode=執行模式
1048
+ config.git_version=Git 版本
1048
1049
config.repo_root_path=儲存庫目錄
1049
1050
config.static_file_root_path=靜態檔案目錄
1050
1051
config.log_file_root_path=日誌檔案目錄
Original file line number Diff line number Diff line change @@ -1045,6 +1045,7 @@ config.offline_mode=離線模式
1045
1045
config.disable_router_log=關閉路由日誌
1046
1046
config.run_user=執行用戶
1047
1047
config.run_mode=執行模式
1048
+ config.git_version=Git 版本
1048
1049
config.repo_root_path=儲存庫目錄
1049
1050
config.static_file_root_path=靜態檔案目錄
1050
1051
config.log_file_root_path=日誌檔案目錄
Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ func Config(ctx *context.Context) {
200
200
ctx .Data ["DisableRouterLog" ] = setting .DisableRouterLog
201
201
ctx .Data ["RunUser" ] = setting .RunUser
202
202
ctx .Data ["RunMode" ] = strings .Title (macaron .Env )
203
+ ctx .Data ["GitVersion" ] = setting .Git .Version
203
204
ctx .Data ["RepoRootPath" ] = setting .RepoRootPath
204
205
ctx .Data ["StaticRootPath" ] = setting .StaticRootPath
205
206
ctx .Data ["LogRootPath" ] = setting .LogRootPath
Original file line number Diff line number Diff line change 32
32
33
33
<div class="ui divider"></div>
34
34
35
+ <dt>{{.i18n.Tr "admin.config.git_version"}}</dt>
36
+ <dd>{{.GitVersion}}</dd>
37
+
38
+ <div class="ui divider"></div>
39
+
35
40
<dt>{{.i18n.Tr "admin.config.repo_root_path"}}</dt>
36
41
<dd>{{.RepoRootPath}}</dd>
37
42
<dt>{{.i18n.Tr "admin.config.static_file_root_path"}}</dt>
You can’t perform that action at this time.
0 commit comments