Documentation ¶
Index ¶
- Variables
- type Cli
- func (cli *Cli) AddFile(ctx context.Context, repositoryPath string, filespec string) error
- func (cli *Cli) AddFileExecPermission(ctx context.Context, repositoryPath string, file string) error
- func (cli *Cli) AddRemote(ctx context.Context, repositoryPath string, remoteName string, ...) error
- func (cli *Cli) CheckInstalled(ctx context.Context) error
- func (cli *Cli) Commit(ctx context.Context, repositoryPath string, message string) error
- func (cli *Cli) GetCurrentBranch(ctx context.Context, repositoryPath string) (string, error)
- func (cli *Cli) GetRemoteUrl(ctx context.Context, repositoryPath string, remoteName string) (string, error)
- func (cli *Cli) GetRepoRoot(ctx context.Context, repositoryPath string) (string, error)
- func (cli *Cli) InitRepo(ctx context.Context, repositoryPath string) error
- func (cli *Cli) InstallUrl() string
- func (cli *Cli) IsUntrackedFile(ctx context.Context, repositoryPath string, filePath string) (bool, error)
- func (cli *Cli) ListStagedFiles(ctx context.Context, repositoryPath string) (string, error)
- func (cli *Cli) Name() string
- func (cli *Cli) PushUpstream(ctx context.Context, repositoryPath string, origin string, branch string) error
- func (cli *Cli) SetCredentialStore(ctx context.Context, repositoryPath string) error
- func (cli *Cli) SetGitHubAuthForRepo(ctx context.Context, repositoryPath, credential, ghPath string) error
- func (cli *Cli) ShallowClone(ctx context.Context, repositoryPath string, branch string, target string) error
- func (cli *Cli) UpdateRemote(ctx context.Context, repositoryPath string, remoteName string, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSuchRemote = errors.New("no such remote")
View Source
var ErrNotRepository = errors.New("not a git repository")
Functions ¶
This section is empty.
Types ¶
type Cli ¶
type Cli struct {
// contains filtered or unexported fields
}
func NewCli ¶
func NewCli(commandRunner exec.CommandRunner) *Cli
func (*Cli) AddFileExecPermission ¶
func (*Cli) GetCurrentBranch ¶
func (*Cli) GetRemoteUrl ¶
func (*Cli) GetRepoRoot ¶
func (*Cli) InstallUrl ¶
func (*Cli) IsUntrackedFile ¶
func (*Cli) ListStagedFiles ¶
func (*Cli) PushUpstream ¶
func (*Cli) SetCredentialStore ¶
func (*Cli) SetGitHubAuthForRepo ¶
func (cli *Cli) SetGitHubAuthForRepo(ctx context.Context, repositoryPath, credential, ghPath string) error
SetGitHubAuthForRepo creates git config for the repositoryPath like
[credential "https://github.com"] (when credential is equal to "https://github.com") helper = helper = !ghPath auth git-credential
This way, git commands run from repositoryPath will use gh as auth credential. Note: Removes any previous configuration for the credential. Note: `helper = ` is intentional to break the chain of previously configured global helpers. See: https://github.com/cli/cli/issues/3796 for more about this strategy.
func (*Cli) ShallowClone ¶
Click to show internal directories.
Click to hide internal directories.