Backport #29287 (cherry picked from commit 9379352db638aa99ee9f4a7d2755966f3d866541)
This commit is contained in:
parent
c49dd9de9b
commit
a1fb6a2346
1 changed files with 5 additions and 7 deletions
|
@ -9,7 +9,6 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/git"
|
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"code.gitea.io/gitea/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
)
|
)
|
||||||
|
@ -94,7 +93,7 @@ done
|
||||||
`, setting.ScriptType, util.ShellEscape(setting.AppPath), util.ShellEscape(setting.CustomConf)),
|
`, setting.ScriptType, util.ShellEscape(setting.AppPath), util.ShellEscape(setting.CustomConf)),
|
||||||
}
|
}
|
||||||
|
|
||||||
if git.SupportProcReceive {
|
// 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")
|
hookNames = append(hookNames, "proc-receive")
|
||||||
hookTpls = append(hookTpls,
|
hookTpls = append(hookTpls,
|
||||||
fmt.Sprintf(`#!/usr/bin/env %s
|
fmt.Sprintf(`#!/usr/bin/env %s
|
||||||
|
@ -102,7 +101,6 @@ done
|
||||||
%s hook --config=%s proc-receive
|
%s hook --config=%s proc-receive
|
||||||
`, setting.ScriptType, util.ShellEscape(setting.AppPath), util.ShellEscape(setting.CustomConf)))
|
`, setting.ScriptType, util.ShellEscape(setting.AppPath), util.ShellEscape(setting.CustomConf)))
|
||||||
giteaHookTpls = append(giteaHookTpls, "")
|
giteaHookTpls = append(giteaHookTpls, "")
|
||||||
}
|
|
||||||
|
|
||||||
return hookNames, hookTpls, giteaHookTpls
|
return hookNames, hookTpls, giteaHookTpls
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue