Documentation
¶
Index ¶
- func Detect(dir string) bool
- func GetCurrentBranch(dir string) (string, error)
- func GetCurrentCommit(dir string) (string, error)
- func GetGitRoot(dir string) string
- func GetRemoteURL(dir string) (string, error)
- func IsDirty(dir string) bool
- func IsTracking(dir string, pattern string) bool
- func MakeGitInfo(dir string) api.GitInfo
- type FileSize
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentBranch ¶
func GetCurrentCommit ¶
func GetGitRoot ¶
If the given directory is in a Git repository, GetGitRoot checks whether the given folder is in a Git repository, then returns the absolute path to the root folder of that Git repository, or the dir given as argument when it is not a Git repo.
func GetRemoteURL ¶
GetRemoteURL returns the URL of the `origin` Git remote.
func IsTracking ¶
IsTracking checks whether the Git repository in the given folder is tracking the files specified by the given pattern. This can be a literal folder or file name, but can also be a pattern containing wildcards, e.g. 'foo.*'
func MakeGitInfo ¶
MakeGitInfo creates a description of the Git repository in the given directory. Returns an empty api.GitInfo{} when the dir is not a Git repo.
Types ¶
type FileSize ¶
FileSize is the return type for FindLargeFiles. Contains the path to the file and its filesize, and, if specified, the commit hash on which the given file was created.
func FindLargeFiles ¶
FindLargeFiles looks for any files being tracked in the current Git repository that have a filesize larger than the given threshold, measured in bytes.