mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-20 20:07:03 +01:00
Always write proc-receive hook for all git versions (#29287)
(cherry picked from commit 7f45dfb030f30a3ada58e636e3b8bfde391224bd)
This commit is contained in:
parent
d3a642a7e0
commit
2c8f112c1c
1 changed files with 5 additions and 7 deletions
|
@ -9,7 +9,6 @@ import (
|
|||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
)
|
||||
|
@ -94,15 +93,14 @@ done
|
|||
`, setting.ScriptType, util.ShellEscape(setting.AppPath), util.ShellEscape(setting.CustomConf)),
|
||||
}
|
||||
|
||||
if git.SupportProcReceive {
|
||||
hookNames = append(hookNames, "proc-receive")
|
||||
hookTpls = append(hookTpls,
|
||||
fmt.Sprintf(`#!/usr/bin/env %s
|
||||
// although only new git (>=2.29) supports proc-receive, it's still good to create its hook, in case the user upgrades git
|
||||
hookNames = append(hookNames, "proc-receive")
|
||||
hookTpls = append(hookTpls,
|
||||
fmt.Sprintf(`#!/usr/bin/env %s
|
||||
# AUTO GENERATED BY GITEA, DO NOT MODIFY
|
||||
%s hook --config=%s proc-receive
|
||||
`, setting.ScriptType, util.ShellEscape(setting.AppPath), util.ShellEscape(setting.CustomConf)))
|
||||
giteaHookTpls = append(giteaHookTpls, "")
|
||||
}
|
||||
giteaHookTpls = append(giteaHookTpls, "")
|
||||
|
||||
return hookNames, hookTpls, giteaHookTpls
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue