Documentation
¶
Overview ¶
Package git owns git CLI interaction for initech project bootstrap. It handles repo initialization, submodule management, and commits.
All operations take an exec.Runner, making the package fully testable without a real git installation. This package does not know about config or scaffold.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSubmodule ¶
AddSubmodule adds a git submodule at the specified path within the repo. The path is relative to the repo root (e.g., "eng1/src"). The URL is normalized before use (bare hostnames get git@ SSH prefix).
func CommitAll ¶
CommitAll stages all files and creates a commit with the given message. Returns an error if staging or commit fails.
func Init ¶
Init runs git init in the given directory. If the directory already contains a .git directory, it's a no-op and returns nil.
func NormalizeRepoURL ¶ added in v1.5.8
NormalizeRepoURL converts bare repository references like "github.com/user/repo" into proper git URLs. If the URL already has a recognized protocol prefix (https://, http://, git@, ssh://), it is returned unchanged. Otherwise, the first "/" after the host is converted to ":" and "git@" is prepended, producing SSH URLs like "git@github.com:user/repo.git".
Types ¶
This section is empty.