diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-19 11:20:24 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-19 11:20:24 +0800 |
commit | 54926a719de46b3c359f2f7ce3c29ff4fe55397b (patch) | |
tree | b81028ae83c949807313a54296bf6d0b59bea8a0 /git_init.go | |
parent | Remove underscores from Go code, pt 2 (diff) | |
download | forge-54926a719de46b3c359f2f7ce3c29ff4fe55397b.tar.gz forge-54926a719de46b3c359f2f7ce3c29ff4fe55397b.tar.zst forge-54926a719de46b3c359f2f7ce3c29ff4fe55397b.zip |
Remove underscores from Go code, pt 3
Diffstat (limited to '')
-rw-r--r-- | git_init.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/git_init.go b/git_init.go index 4313ee8..045ddd2 100644 --- a/git_init.go +++ b/git_init.go @@ -5,28 +5,28 @@ package main import ( "github.com/go-git/go-git/v5" - git_config "github.com/go-git/go-git/v5/config" - git_format_config "github.com/go-git/go-git/v5/plumbing/format/config" + gitConfig "github.com/go-git/go-git/v5/config" + gitFmtConfig "github.com/go-git/go-git/v5/plumbing/format/config" ) -// git_bare_init_with_default_hooks initializes a bare git repository with the +// gitInit initializes a bare git repository with the // forge-deployed hooks directory as the hooksPath. -func git_bare_init_with_default_hooks(repo_path string) (err error) { +func gitInit(repoPath string) (err error) { var repo *git.Repository - var git_config *git_config.Config + var gitConf *gitConfig.Config - if repo, err = git.PlainInit(repo_path, true); err != nil { + if repo, err = git.PlainInit(repoPath, true); err != nil { return err } - if git_config, err = repo.Config(); err != nil { + if gitConf, err = repo.Config(); err != nil { return err } - git_config.Raw.SetOption("core", git_format_config.NoSubsection, "hooksPath", config.Hooks.Execs) - git_config.Raw.SetOption("receive", git_format_config.NoSubsection, "advertisePushOptions", "true") + gitConf.Raw.SetOption("core", gitFmtConfig.NoSubsection, "hooksPath", config.Hooks.Execs) + gitConf.Raw.SetOption("receive", gitFmtConfig.NoSubsection, "advertisePushOptions", "true") - if err = repo.SetConfig(git_config); err != nil { + if err = repo.SetConfig(gitConf); err != nil { return err } |