diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:52:04 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:52:04 +0800 |
commit | b4b0d966340ad9c892f8b8912eebc6118eed7482 (patch) | |
tree | 0512a6dd5cfc21fbd91a07d31f972aa2a1cf844d /git_init.go | |
parent | git2c: git2c.go -> client.go, a more sensible name (diff) | |
download | forge-b4b0d966340ad9c892f8b8912eebc6118eed7482.tar.gz forge-b4b0d966340ad9c892f8b8912eebc6118eed7482.tar.zst forge-b4b0d966340ad9c892f8b8912eebc6118eed7482.zip |
Use cmd/forge for the entry point
Diffstat (limited to 'git_init.go')
-rw-r--r-- | git_init.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/git_init.go b/git_init.go index 1800c5a..b448451 100644 --- a/git_init.go +++ b/git_init.go @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org> -package main +package forge import ( "github.com/go-git/go-git/v5" @@ -11,7 +11,7 @@ import ( // gitInit initializes a bare git repository with the forge-deployed hooks // directory as the hooksPath. -func (s *server) 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 (s *server) gitInit(repoPath string) (err error) { return err } - gitConf.Raw.SetOption("core", gitFmtConfig.NoSubsection, "hooksPath", s.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 { |