aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-05-07 00:34:16 +0800
committerGitHub <noreply@github.com>2024-05-06 18:34:16 +0200
commit7c613f100e032f821df88a75954fc50b1cf2f926 (patch)
tree18f73e576eb62a593395919b765e7583f1a1ba06 /routers/web
parent8e8ca6c6530e49e39f970bdfa84716ffda8973d0 (diff)
downloadgitea-7c613f100e032f821df88a75954fc50b1cf2f926.tar.gz
gitea-7c613f100e032f821df88a75954fc50b1cf2f926.zip
Make sure git version&feature are always prepared (#30877)
Otherwise there would be more similar issues like #29287
Diffstat (limited to 'routers/web')
-rw-r--r--routers/web/admin/config.go2
-rw-r--r--routers/web/misc/misc.go2
-rw-r--r--routers/web/repo/githttp.go2
-rw-r--r--routers/web/repo/repo.go2
4 files changed, 4 insertions, 4 deletions
diff --git a/routers/web/admin/config.go b/routers/web/admin/config.go
index 48f80dbbf1..fd8c73b62d 100644
--- a/routers/web/admin/config.go
+++ b/routers/web/admin/config.go
@@ -112,7 +112,7 @@ func Config(ctx *context.Context) {
ctx.Data["OfflineMode"] = setting.OfflineMode
ctx.Data["RunUser"] = setting.RunUser
ctx.Data["RunMode"] = util.ToTitleCase(setting.RunMode)
- ctx.Data["GitVersion"] = git.VersionInfo()
+ ctx.Data["GitVersion"] = git.DefaultFeatures().VersionInfo()
ctx.Data["AppDataPath"] = setting.AppDataPath
ctx.Data["RepoRootPath"] = setting.RepoRootPath
diff --git a/routers/web/misc/misc.go b/routers/web/misc/misc.go
index ac5496ce91..caaca7f521 100644
--- a/routers/web/misc/misc.go
+++ b/routers/web/misc/misc.go
@@ -15,7 +15,7 @@ import (
)
func SSHInfo(rw http.ResponseWriter, req *http.Request) {
- if !git.DefaultFeatures.SupportProcReceive {
+ if !git.DefaultFeatures().SupportProcReceive {
rw.WriteHeader(http.StatusNotFound)
return
}
diff --git a/routers/web/repo/githttp.go b/routers/web/repo/githttp.go
index 8fb6d93068..f0579b56ea 100644
--- a/routers/web/repo/githttp.go
+++ b/routers/web/repo/githttp.go
@@ -183,7 +183,7 @@ func httpBase(ctx *context.Context) *serviceHandler {
if repoExist {
// Because of special ref "refs/for" .. , need delay write permission check
- if git.DefaultFeatures.SupportProcReceive {
+ if git.DefaultFeatures().SupportProcReceive {
accessMode = perm.AccessModeRead
}
diff --git a/routers/web/repo/repo.go b/routers/web/repo/repo.go
index 4e448933c7..48be1c2296 100644
--- a/routers/web/repo/repo.go
+++ b/routers/web/repo/repo.go
@@ -180,7 +180,7 @@ func Create(ctx *context.Context) {
ctx.Data["CanCreateRepo"] = ctx.Doer.CanCreateRepo()
ctx.Data["MaxCreationLimit"] = ctx.Doer.MaxCreationLimit()
- ctx.Data["SupportedObjectFormats"] = git.SupportedObjectFormats
+ ctx.Data["SupportedObjectFormats"] = git.DefaultFeatures().SupportedObjectFormats
ctx.Data["DefaultObjectFormat"] = git.Sha1ObjectFormat
ctx.HTML(http.StatusOK, tplCreate)