aboutsummaryrefslogtreecommitdiffstats
path: root/routers/private
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/private
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/private')
-rw-r--r--routers/private/hook_pre_receive.go2
-rw-r--r--routers/private/hook_proc_receive.go2
-rw-r--r--routers/private/serv.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/routers/private/hook_pre_receive.go b/routers/private/hook_pre_receive.go
index 7189fd715c..0a3c8e2559 100644
--- a/routers/private/hook_pre_receive.go
+++ b/routers/private/hook_pre_receive.go
@@ -122,7 +122,7 @@ func HookPreReceive(ctx *gitea_context.PrivateContext) {
preReceiveBranch(ourCtx, oldCommitID, newCommitID, refFullName)
case refFullName.IsTag():
preReceiveTag(ourCtx, refFullName)
- case git.DefaultFeatures.SupportProcReceive && refFullName.IsFor():
+ case git.DefaultFeatures().SupportProcReceive && refFullName.IsFor():
preReceiveFor(ourCtx, refFullName)
default:
ourCtx.AssertCanWriteCode()
diff --git a/routers/private/hook_proc_receive.go b/routers/private/hook_proc_receive.go
index cee3bbdd12..efb3f5831e 100644
--- a/routers/private/hook_proc_receive.go
+++ b/routers/private/hook_proc_receive.go
@@ -18,7 +18,7 @@ import (
// HookProcReceive proc-receive hook - only handles agit Proc-Receive requests at present
func HookProcReceive(ctx *gitea_context.PrivateContext) {
opts := web.GetForm(ctx).(*private.HookOptions)
- if !git.DefaultFeatures.SupportProcReceive {
+ if !git.DefaultFeatures().SupportProcReceive {
ctx.Status(http.StatusNotFound)
return
}
diff --git a/routers/private/serv.go b/routers/private/serv.go
index 85368a0aed..1c309865d7 100644
--- a/routers/private/serv.go
+++ b/routers/private/serv.go
@@ -297,7 +297,7 @@ func ServCommand(ctx *context.PrivateContext) {
}
} else {
// Because of the special ref "refs/for" we will need to delay write permission check
- if git.DefaultFeatures.SupportProcReceive && unitType == unit.TypeCode {
+ if git.DefaultFeatures().SupportProcReceive && unitType == unit.TypeCode {
mode = perm.AccessModeRead
}