Documentation
¶
Index ¶
- func BuildRemoteURLFromRepoDir(repoDir, gitReplicatorRoot string) (string, error)
- func DefaultCloneFunc(ctx context.Context, url, dir string) error
- func DefaultGetRemoteURL(repoDir, gitReplicatorRoot string) (string, error)
- func DefaultSwitchBranchFunc(ctx context.Context, repoDir, branchName string) error
- func FindRepoDir(cwd, gitReplicatorRoot string) (string, error)
- func GetGitReplicatorRoot() (string, error)
- func InitLogger()
- func RemoveDir(dir string) error
- func SwitchBranch(ctx context.Context, repoDir, branchName string) error
- type GitURLParts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultGetRemoteURL ¶
Validate that repoDir is under gitReplicatorRoot and build the remote URL
func DefaultSwitchBranchFunc ¶
DefaultSwitchBranchFunc is the default implementation for switching branches, for external use
func FindRepoDir ¶
FindRepoDir walks up from cwd to gitReplicatorRoot and returns the repo directory (the second-level directory under gitReplicatorRoot, e.g., $HOME/git-replicator/owner/repo).
func GetGitReplicatorRoot ¶
GetGitReplicatorRoot returns the path to $HOME/git-replicator
func InitLogger ¶
func InitLogger()
Types ¶
type GitURLParts ¶
func ParseGitURL ¶
func ParseGitURL(rawurl string) (GitURLParts, error)
Click to show internal directories.
Click to hide internal directories.