Documentation
¶
Overview ¶
Package git finds the Git repository a folder belongs to and its origin remote by reading the repository's files. It never runs the git command: the person may have Git only inside GitHub Desktop or an editor, and an app started from the desktop may not see the git their terminal runs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Inspect(ctx context.Context, path string) (Repository, error)
}
type FileClient ¶ added in v0.10.0
type FileClient struct{}
FileClient reads a repository's .git directory, or the .git file of a worktree or submodule, and its config.
func NewClient ¶ added in v0.10.0
func NewClient() FileClient
func (FileClient) Inspect ¶ added in v0.10.0
func (FileClient) Inspect(ctx context.Context, path string) (Repository, error)
Inspect finds the nearest folder at or above path that holds .git, as git does. A folder outside any repository is not an error: HasGit is false.