gitcli

package
v0.1.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseOwnerRepo

func ParseOwnerRepo(remoteURL string) (string, string, error)

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

func New

func New() *CLI

func NewWithExecutor

func NewWithExecutor(ex Executor) *CLI

func (*CLI) CheckoutBranch

func (c *CLI) CheckoutBranch(ctx context.Context, repoPath string, branchName string) error

func (*CLI) HasPendingChanges

func (c *CLI) HasPendingChanges(ctx context.Context, repoPath string) bool

HasPendingChanges checks if a repository has pending changes that need attention. It checks for: - Local uncommitted changes (dirty working tree) - Local commits not pushed to remote (ahead > 0) This is a lightweight check that performs a quick git fetch.

func (*CLI) HasRemoteUpdate

func (c *CLI) HasRemoteUpdate(ctx context.Context, repoPath string) bool

HasRemoteUpdate checks if a repository has remote updates that need to be pulled. It checks if local branch is behind remote (needs pull). This is a lightweight check that performs a quick git fetch.

func (*CLI) ListBranches

func (c *CLI) ListBranches(ctx context.Context, repoPath string, dirty bool) ([]model.BranchInfo, error)

func (*CLI) ParseOwnerRepoFromRemote

func (c *CLI) ParseOwnerRepoFromRemote(ctx context.Context, repoPath string) (string, string, error)

func (*CLI) Pull

func (c *CLI) Pull(ctx context.Context, repoPath string) error

Pull executes git pull for the current branch in the specified repository.

func (*CLI) RefreshRepo

func (c *CLI) RefreshRepo(ctx context.Context, repoName string, repoPath string) model.RepoStatus

type Executor

type Executor interface {
	Run(ctx context.Context, dir string, args ...string) (string, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL