aboutsummaryrefslogtreecommitdiff
path: root/git_init.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 20:21:32 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 20:21:32 +0800
commit71ab9b7f14118f02dd18cd733bd4e0ad19ece590 (patch)
tree0303cbee651a4e1cee62a348d25066b9543f4425 /git_init.go
parentgit2d: Remove UTF-8 checks (diff)
downloadforge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.gz
forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.zst
forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.zip
config shall no longer be a global variable
Diffstat (limited to '')
-rw-r--r--git_init.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/git_init.go b/git_init.go
index f1a283e..1800c5a 100644
--- a/git_init.go
+++ b/git_init.go
@@ -11,7 +11,7 @@ import (
// gitInit initializes a bare git repository with the forge-deployed hooks
// directory as the hooksPath.
-func gitInit(repoPath string) (err error) {
+func (s *server) gitInit(repoPath string) (err error) {
var repo *git.Repository
var gitConf *gitConfig.Config
@@ -23,7 +23,7 @@ func gitInit(repoPath string) (err error) {
return err
}
- gitConf.Raw.SetOption("core", gitFmtConfig.NoSubsection, "hooksPath", config.Hooks.Execs)
+ gitConf.Raw.SetOption("core", gitFmtConfig.NoSubsection, "hooksPath", s.config.Hooks.Execs)
gitConf.Raw.SetOption("receive", gitFmtConfig.NoSubsection, "advertisePushOptions", "true")
if err = repo.SetConfig(gitConf); err != nil {