Documentation
¶
Index ¶
- func Clone(ctx context.Context, url, dir string, shallow bool) error
- func CountAheadBehind(ctx context.Context, dir string) (behind, ahead int)
- func Fetch(ctx context.Context, dir string, force bool) error
- func IsDirty(ctx context.Context, dir string) bool
- func IsOffDefault(ctx context.Context, dir string) bool
- func IsRepo(ctx context.Context, dir string) bool
- func Pull(ctx context.Context, dir string) error
- type RepoStatus
- type SkipError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clone ¶
Clone runs git clone. When shallow is true, uses --depth 1 --filter=blob:none for a faster, smaller clone (no blob history).
func CountAheadBehind ¶ added in v0.1.2
CountAheadBehind returns the number of commits the repo is behind/ahead of its upstream tracking branch. Returns 0,0 when no upstream is configured.
func IsDirty ¶ added in v0.1.1
IsDirty reports whether the repo has uncommitted changes to tracked files. Untracked files do not count. Returns false when dir is not a git repo.
func IsOffDefault ¶ added in v0.1.3
IsOffDefault reports whether the current branch differs from the remote's default branch. Returns false when refs/remotes/origin/HEAD is not set.
Types ¶
Click to show internal directories.
Click to hide internal directories.