Documentation
¶
Index ¶
- type Client
- func (c *Client) Add(paths ...string) error
- func (c *Client) Commit(message string) error
- func (c *Client) Config() (*Config, error)
- func (c *Client) DirtyFiles(excludePatterns ...string) ([]string, error)
- func (c *Client) GetRemoteNamed(name string) (*config.RemoteConfig, error)
- func (c *Client) HeadCommit() (Commit, error)
- func (c *Client) Log(n int) ([]Commit, error)
- func (c *Client) RepoRelativeDir() (string, error)
- func (c *Client) RootDir() string
- func (c *Client) WorkDir() string
- func (c *Client) WorktreeState(opts ...WorktreeStateOption) (WorktreeState, error)
- type ClientOptions
- type Commit
- type Config
- type Option
- type WorktreeState
- type WorktreeStateConfig
- type WorktreeStateOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DirtyFiles ¶
DirtyFiles returns a list of files that have been modified in any way, including: new (untracked), contents changed, deleted, renamed, copied, unmerged, whether the changes have been staged or not. It also includes files that are ignored by the standard ignore files. The list is sorted using strings.Sort.
func (*Client) GetRemoteNamed ¶
func (c *Client) GetRemoteNamed(name string) (*config.RemoteConfig, error)
func (*Client) HeadCommit ¶
func (*Client) RepoRelativeDir ¶
func (*Client) WorktreeState ¶
func (c *Client) WorktreeState(opts ...WorktreeStateOption) (WorktreeState, error)
SourceInfo returns the SourceInfo of the repo.
type ClientOptions ¶
type ClientOptions struct {
// contains filtered or unexported fields
}
type WorktreeState ¶
type WorktreeState struct { Head Commit // SourceHash is the SHA1 Git Commit ID of Head if the worktree is not dirty. // Otherwise it's a SHA1 hash of the head commit along with the full // contents of all changed files. // SHA1 is used for both so that you get a consistent 40 char hex string. SourceHash string // DirtyFiles is a list of all files flagged as dirty in the worktree. DirtyFiles []string }
func (WorktreeState) IsDirty ¶
func (ws WorktreeState) IsDirty() bool
IsDirty returns true if the source hash isn't exactly the same as the head commit ID.
type WorktreeStateConfig ¶
type WorktreeStateConfig struct {
// contains filtered or unexported fields
}
type WorktreeStateOption ¶
type WorktreeStateOption func(*WorktreeStateConfig)
func WorktreeStateIgnorePatterns ¶
func WorktreeStateIgnorePatterns(patterns ...string) WorktreeStateOption
Click to show internal directories.
Click to hide internal directories.