Documentation
¶
Overview ¶
Package exec is the GitClient that runs the git binary through a CommandRunner.
Index ¶
- type Client
- func (c *Client) ChangedSince(ctx context.Context, root, base string) ([]string, error)
- func (c *Client) Diff(ctx context.Context, root string, args ...string) ([]byte, error)
- func (c *Client) HasPathsChanged(ctx context.Context, root, from, to string, paths []string) (bool, error)
- func (c *Client) IsRepo(ctx context.Context, root string) bool
- func (c *Client) LsFiles(ctx context.Context, root string, pathspecs []string) ([]string, error)
- func (c *Client) RevParse(ctx context.Context, root, ref string) (string, error)
- func (c *Client) StageFiles(ctx context.Context, root string, paths []string) error
- func (c *Client) StagedFiles(ctx context.Context, root string, patterns []string) ([]string, error)
- func (c *Client) Tag(ctx context.Context, root string) (string, error)
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
}
Client runs git.
func New ¶
func New(runner interfaces.CommandRunner) *Client
New returns the Client over runner. It does no I/O.
func (*Client) ChangedSince ¶
ChangedSince lists the files changed since the merge base with base.
func (*Client) HasPathsChanged ¶
func (c *Client) HasPathsChanged( ctx context.Context, root, from, to string, paths []string, ) (bool, error)
HasPathsChanged runs `git diff --quiet from to -- paths`; exit 1 means changed.
func (*Client) StageFiles ¶
StageFiles runs `git add -- paths`; no paths is a no-op.
Click to show internal directories.
Click to hide internal directories.