Documentation
¶
Index ¶
- func Add(dir string, files []string) error
- func Checkout(dir, branch string) error
- func Commit(dir, message string) error
- func CreateBranch(dir, name string) error
- func CreateWorktree(of, name, ref string) (string, error)
- func Diff(dir string, ref string) ([]string, error)
- func EnsureCleanAndUpToDateWorkingCopy(catalogDir string, ref string, out io.Writer) error
- func Fetch(dir string) error
- func FetchTags(dir string) error
- func GetCurrentBranch(dir string) (string, error)
- func GetCurrentCommit(dir string) (string, error)
- func GetUncommittedChanges(dir string) ([]string, error)
- func GetUncommittedChangesWithOpts(dir string, opts UncommittedChangesOptions) ([]string, error)
- func IsBranchInSyncWithRemote(dir string, branch string) (bool, error)
- func IsDirty(dir string, opts UncommittedChangesOptions) (bool, error)
- func IsRemoteBranch(dir, ref string) (bool, error)
- func IsValid(dir string) bool
- func Pull(dir string, args ...string) error
- func Push(dir string, args ...string) error
- func PushNewBranch(dir, name string) error
- func RemoveWorktree(of, path string) error
- func Reset(dir string) error
- func ResolveCommit(dir, ref string) (string, error)
- func RevParse(of, ref string) (string, error)
- func Run(dir string, io internal.IO, args []string) error
- func Stash(dir string) error
- func StashApply(dir string) error
- func SwitchBack(dir string) error
- type UncommittedChangesOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBranch ¶
func CreateWorktree ¶ added in v0.79.0
CreateWorktree creates a worktree within joy's cache with the given name at the given ref. It attempts a best effort removal of the worktree if it exists prior to running this command.
func EnsureCleanAndUpToDateWorkingCopy ¶
EnsureCleanAndUpToDateWorkingCopy checks out the given ref in the catalog after ensuring there are no local changes. When the ref is a remote branch, it is also pulled and verified to match its remote counterpart.
func GetCurrentBranch ¶
func GetCurrentCommit ¶
func GetUncommittedChanges ¶
func GetUncommittedChangesWithOpts ¶ added in v0.54.3
func GetUncommittedChangesWithOpts(dir string, opts UncommittedChangesOptions) ([]string, error)
func IsBranchInSyncWithRemote ¶
IsBranchInSyncWithRemote fetches given branch from origin and reports whether the local branch points to the same commit as its origin counterpart, regardless of the branch currently checked out. A missing local branch is not in sync.
func IsDirty ¶ added in v0.35.0
func IsDirty(dir string, opts UncommittedChangesOptions) (bool, error)
IsDirty check if any files in the the git directory specified by dir have been modified.
func IsRemoteBranch ¶ added in v0.101.0
IsRemoteBranch reports whether ref is the name of a branch on origin, as opposed to a tag or commit.
func PushNewBranch ¶
func RemoveWorktree ¶ added in v0.79.0
func ResolveCommit ¶ added in v0.101.0
ResolveCommit returns the commit sha that ref points to, failing if ref does not resolve to a commit.
func RevParse ¶ added in v0.79.0
RevParse performs git rev-parse for a given revision. If the argument is ambiguous, like that of a branch that has never been checked out, we try the origin revision.
func StashApply ¶ added in v0.35.0
func SwitchBack ¶ added in v0.34.0
Types ¶
type UncommittedChangesOptions ¶ added in v0.54.3
type UncommittedChangesOptions struct {
SkipUntrackedFiles bool
}