{"modulePath":"github.com/DomBlack/git-stack","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git\n\nPackage git is a typed wrapper around the git command line. It shells out through pkg/exec; go-git is deliberately not used so behaviour matches the user's git exactly (hooks, config, worktrees, signing).\n\n## Constants\n\n```go\nconst DefaultLockRetryBudget = 2 * time.Second\n```\nDefaultLockRetryBudget is how long git commands wait for a held index lock before giving up. IDEs and agents take the lock for milliseconds at a time while refreshing status, which is plenty to make a bare \\`git add\\` fail.\n\n```go\nconst MinVersion = \"2.40.0\"\n```\nMinVersion is the oldest git git-stack supports.\n\n## Variables\n\n```go\nvar ErrDetached = errors.New(\"HEAD is detached\")\n```\nErrDetached is returned when HEAD is not on a branch.\n\n```go\nvar ErrIndexLocked = errors.New(\"the index is locked by another git process\")\n```\nErrIndexLocked matches the error git commands return when another process held a worktree's index lock (index.lock) for longer than the retry budget. git-stack never removes a lock itself.\n\n```go\nvar ErrNotRepo = errors.New(\"not a git repository\")\n```\nErrNotRepo is returned by Discover outside a git repository.\n\n```go\nvar ErrRefLocked = errors.New(\"a ref is locked by another git process\")\n```\nErrRefLocked matches a command that failed because another process held a ref's lock file (refs/heads/main.lock, packed-refs.lock).\n\n## Functions\n\n```go\nfunc LockPath(err error) string\n```\nLockPath is the lock file a command failed on (ErrIndexLocked or ErrRefLocked), or \"\".\n\n## Types\n\n```go\ntype AddMode int\n```\nAddMode selects what \\`git add\\` stages.\n\n```go\nconst (\n\t// AddNone stages nothing.\n\tAddNone AddMode = iota\n\t// AddAll stages all changes including untracked files (git add -A).\n\tAddAll\n\t// AddUpdate stages changes to tracked files only (git add -u).\n\tAddUpdate\n\t// AddPatch stages hunks interactively (git add -p); needs a TTY.\n\tAddPatch\n)\n```\n\n```go\ntype Branch struct {\n\tName string\n\t// Head is the tip commit id.\n\tHead string\n\t// CommitTime is the committer date of the tip.\n\tCommitTime time.Time\n\t// Worktree is the path of the worktree the branch is checked out in, or\n\t// empty.\n\tWorktree string\n\t// Upstream is the tracking branch (e.g. origin/feat), or empty.\n\tUpstream string\n}\n```\nBranch describes a local branch.\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient runs git commands.\n\n```go\nfunc New(r exec.Runner, opts ...Option) *Client\n```\nNew returns a Client that runs git through r.\n\n```go\nfunc (c *Client) Add(ctx context.Context, repo Repo, mode AddMode) error\n```\nAdd stages changes according to mode.\n\n```go\nfunc (c *Client) AddedPaths(ctx context.Context, repo Repo, from, to string) ([]string, error)\n```\nAddedPaths lists the paths that exist in to's tree but not in from's.\n\n```go\nfunc (c *Client) BranchExists(ctx context.Context, repo Repo, name string) (bool, error)\n```\nBranchExists reports whether a local branch exists.\n\n```go\nfunc (c *Client) Branches(ctx context.Context, repo Repo) ([]Branch, error)\n```\nBranches lists local branches sorted by name.\n\n```go\nfunc (c *Client) ChangedFiles(ctx context.Context, repo Repo) ([]string, error)\n```\nChangedFiles lists tracked files with staged or unstaged changes in the worktree at repo, relative to it. It reads with --no-optional-locks, as it may look at another worktree.\n\n```go\nfunc (c *Client) ChangedPaths(ctx context.Context, repo Repo, from, to string) ([]string, error)\n```\nChangedPaths lists the paths whose content differs between the trees of from and to.\n\n```go\nfunc (c *Client) CheckRefFormat(ctx context.Context, name string) error\n```\nCheckRefFormat validates name as a branch name.\n\n```go\nfunc (c *Client) Commit(ctx context.Context, repo Repo, o CommitOptions) (string, error)\n```\nCommit creates or amends a commit and returns the new HEAD id. When the editor must open (no message and not NoEdit, or Edit), the command runs in passthrough mode.\n\n```go\nfunc (c *Client) CommitInfo(ctx context.Context, repo Repo, rev string) (CommitInfo, error)\n```\nCommitInfo reads rev's author, message, tree and first parent.\n\n```go\nfunc (c *Client) CommitTree(ctx context.Context, repo Repo, tree, parent string, info CommitInfo) (string, error)\n```\nCommitTree creates a commit of tree on parent with info's author, author date and message. The committer is the current user. The commit is not signed: unlike commit and rebase, commit-tree ignores commit.gpgsign and only signs when asked with -S, which we don't pass, so a replay never needs the signing key.\n\n```go\nfunc (c *Client) Commits(ctx context.Context, repo Repo, tip string, exclude ...string) ([]Commit, error)\n```\nCommits lists the commits reachable from tip but from none of exclude, newest first. Revisions that don't resolve (a deleted parent branch, a recorded base that was garbage collected) are ignored rather than failing the read, and a missing tip lists nothing. It's a read that can run while another git process works in any worktree, so it takes no optional locks, and the output is NUL separated since a subject can hold anything.\n\n```go\nfunc (c *Client) ConfigAdd(ctx context.Context, repo Repo, scope Scope, key, value string) error\n```\nConfigAdd appends a value to a multi-valued key.\n\n```go\nfunc (c *Client) ConfigGet(ctx context.Context, repo Repo, scope Scope, key string) (string, bool, error)\n```\nConfigGet returns the value of key. The boolean reports whether it was set.\n\n```go\nfunc (c *Client) ConfigGetAll(ctx context.Context, repo Repo, scope Scope, key string) ([]string, error)\n```\nConfigGetAll returns every value of a multi-valued key.\n\n```go\nfunc (c *Client) ConfigGetRegexp(ctx context.Context, repo Repo, scope Scope, re string) ([]ConfigEntry, error)\n```\nConfigGetRegexp returns every entry whose key matches the regexp.\n\n```go\nfunc (c *Client) ConfigSet(ctx context.Context, repo Repo, scope Scope, key, value string) error\n```\nConfigSet sets key to value, replacing existing values.\n\n```go\nfunc (c *Client) ConfigUnset(ctx context.Context, repo Repo, scope Scope, key string) error\n```\nConfigUnset removes every value of key. A missing key is not an error.\n\n```go\nfunc (c *Client) ConfigUnsetValue(ctx context.Context, repo Repo, scope Scope, key, value string) error\n```\nConfigUnsetValue removes the values of key that match the given value (exact match). A missing key or value is not an error.\n\n```go\nfunc (c *Client) ConflictedFiles(ctx context.Context, repo Repo) ([]string, error)\n```\nConflictedFiles lists paths with unresolved merge conflicts.\n\n```go\nfunc (c *Client) CountCommits(ctx context.Context, repo Repo, from, to string) (int, error)\n```\nCountCommits returns the number of commits in from..to.\n\n```go\nfunc (c *Client) CreateBranch(ctx context.Context, repo Repo, name, start string) error\n```\nCreateBranch creates name at start without checking it out.\n\n```go\nfunc (c *Client) CreateTrackingBranch(ctx context.Context, repo Repo, name, remote string) error\n```\nCreateTrackingBranch creates name from remote's copy of it, with remote as its upstream, the way git switch does for a branch that only exists on a remote.\n\n```go\nfunc (c *Client) CurrentBranch(ctx context.Context, repo Repo) (string, error)\n```\nCurrentBranch returns the checked-out branch name.\n\n```go\nfunc (c *Client) DefaultBranch(ctx context.Context, repo Repo) (string, bool, error)\n```\nDefaultBranch guesses the repository's trunk the way gh-stack does: the branch origin/HEAD points at, else a local main or master. The boolean is false when nothing matches.\n\n```go\nfunc (c *Client) DeleteBranch(ctx context.Context, repo Repo, name string) error\n```\nDeleteBranch deletes a local branch whether or not it is merged. git refuses when the branch is checked out in any worktree; callers check.\n\n```go\nfunc (c *Client) DeleteRemoteBranch(ctx context.Context, repo Repo, remote, branch, expect string) error\n```\nDeleteRemoteBranch deletes branch on remote. With expect set, the delete is leased against it, so a branch that has moved on the remote since is refused rather than deleted; with it empty the branch is deleted whatever its tip.\n\n```go\nfunc (c *Client) DiffCommit(ctx context.Context, repo Repo, rev string) (string, error)\n```\nDiffCommit returns rev's changes against its first parent as a zero context diff with renames detected.\n\n```go\nfunc (c *Client) DiffRange(ctx context.Context, repo Repo, base, head string) (string, error)\n```\nDiffRange returns the diff between base and head (base...head semantics are not used: this is the exact tree difference, which is what a rebased branch shows against its parent).\n\n```go\nfunc (c *Client) Discover(ctx context.Context, dir string) (Repo, error)\n```\nDiscover resolves the repository containing dir.\n\n```go\nfunc (c *Client) EmptyTreeCommit(ctx context.Context, repo Repo, parents []string, msg string) (string, error)\n```\nEmptyTreeCommit creates a commit with an empty tree and the given parents. Nothing ever checks it out; a ref pointing at it keeps every parent from being garbage collected.\n\n```go\nfunc (c *Client) Fetch(ctx context.Context, repo Repo, remote string) error\n```\nFetch updates the remote-tracking refs of remote and prunes the ones whose branch is gone. Nothing local moves.\n\n```go\nfunc (c *Client) HasMerges(ctx context.Context, repo Repo, from, to string) (bool, error)\n```\nHasMerges reports whether from..to holds a merge commit.\n\n```go\nfunc (c *Client) HasStagedChanges(ctx context.Context, repo Repo) (bool, error)\n```\nHasStagedChanges reports whether the index differs from HEAD. Like every read that may run against another worktree, it passes --no-optional-locks so it never takes (or trips over) that worktree's index lock just to refresh stat data.\n\n```go\nfunc (c *Client) HasUnstagedChanges(ctx context.Context, repo Repo) (bool, error)\n```\nHasUnstagedChanges reports whether the working tree has unstaged changes to tracked files.\n\n```go\nfunc (c *Client) HasUntrackedFiles(ctx context.Context, repo Repo) (bool, error)\n```\nHasUntrackedFiles reports whether untracked, non-ignored files exist.\n\n```go\nfunc (c *Client) IndexLockPath(ctx context.Context, repo Repo) (string, error)\n```\nIndexLockPath is where git keeps the index lock for the worktree at repo: .git/index.lock for the main one, .git/worktrees/\\\u003cname\u003e/index.lock for a linked one. It only names the file; nothing here ever removes it.\n\n```go\nfunc (c *Client) IsAncestor(ctx context.Context, repo Repo, ancestor, descendant string) (bool, error)\n```\nIsAncestor reports whether ancestor is reachable from descendant.\n\n```go\nfunc (c *Client) ListCmds(ctx context.Context, spec string) ([]string, error)\n```\nListCmds returns \\`git --list-cmds=\\\u003cspec\u003e\\` (e.g. \"builtins\" or \"main,others\").\n\n```go\nfunc (c *Client) LocalChanges(ctx context.Context, repo Repo) ([]string, error)\n```\nLocalChanges lists the paths whose index or working tree content differs from HEAD, relative to the top level. Untracked files are not included; Untracked lists those.\n\n```go\nfunc (c *Client) MergeBase(ctx context.Context, repo Repo, a, b string) (string, error)\n```\nMergeBase returns the best common ancestor of a and b.\n\n```go\nfunc (c *Client) MergeFF(ctx context.Context, repo Repo, rev string) error\n```\nMergeFF fast forwards the branch checked out in repo's worktree to rev and updates the tree. It refuses, changing nothing, when rev is not a descendant or a dirty file would be overwritten.\n\n```go\nfunc (c *Client) MergeTree(ctx context.Context, repo Repo, base, ours, theirs string) (MergeTreeResult, error)\n```\nMergeTree merges ours and theirs with base as the common ancestor.\n\n```go\nfunc (c *Client) Messages(ctx context.Context, repo Repo, from, to string) ([]string, error)\n```\nMessages returns the full commit messages in from..to, oldest first.\n\n```go\nfunc (c *Client) Passthrough(ctx context.Context, repo Repo, args ...string) error\n```\nPassthrough runs git with the terminal attached (editors, \\`add -p\\`).\n\n```go\nfunc (c *Client) PatchIDs(ctx context.Context, repo Repo, from, to string) (map[string]string, error)\n```\nPatchIDs maps the patch id of every non merge commit in from..to to that commit, so two histories can be compared for the same changes regardless of where they were rebased. The ids are verbatim: unlike --stable they count whitespace, so a whitespace only amend is a different change.\n\n```go\nfunc (c *Client) PatchIDsExcluding(ctx context.Context, repo Repo, to string, exclude ...string) (map[string]string, error)\n```\nPatchIDsExcluding is PatchIDs for the commits reachable from to but from none of exclude.\n\n```go\nfunc (c *Client) PatchTree(ctx context.Context, repo Repo, tree, patch string) (string, error)\n```\nPatchTree applies patch, a zero context diff, to tree and returns the new tree. It goes through a temporary index in the git dir, so the real index and working tree are never touched, and the temporary index is removed whether or not it worked. git checks every removed line against the file (line numbers are only a hint to it), so a patch that doesn't fit comes back as a \\*PatchError and nothing is written. git also applies a hunk at an offset when it finds the removed lines elsewhere; a correct plan always matches at the stated line, so an offset is refused too. Whitespace settings are ignored so the applied lines are exactly the patch's.\n\n```go\nfunc (c *Client) PointHEAD(ctx context.Context, repo Repo, branch string) error\n```\nPointHEAD makes branch the current branch without touching the index or the working tree, so whatever differs from its tip shows as changes. git would happily point HEAD at a branch that doesn't exist, so that is refused first.\n\n```go\nfunc (c *Client) PruneWorktrees(ctx context.Context, repo Repo) error\n```\nPruneWorktrees forgets every worktree whose directory is gone, the way git worktree prune does. Locked ones are left alone.\n\n```go\nfunc (c *Client) Push(ctx context.Context, repo Repo, remote string, leases []PushLease) error\n```\nPush force pushes each branch to the same name on remote, all or nothing. Each one is leased against its Expect, so a remote that has moved since the caller looked is refused rather than overwritten.\n\n```go\nfunc (c *Client) RebaseAbort(ctx context.Context, repo Repo) error\n```\nRebaseAbort abandons a rebase in progress; git puts the branch it was rebasing back and checks it out.\n\n```go\nfunc (c *Client) RebaseContinue(ctx context.Context, repo Repo) (stopped bool, err error)\n```\nRebaseContinue resumes a stopped rebase after the conflicts were staged. stopped is true when it stopped again on unresolved conflicts; any other failure is an error.\n\n```go\nfunc (c *Client) RebaseInProgress(ctx context.Context, repo Repo) (bool, error)\n```\nRebaseInProgress reports whether git has a rebase in progress.\n\n```go\nfunc (c *Client) RebaseMatches(ctx context.Context, repo Repo, branch, onto, tip string) (bool, error)\n```\nRebaseMatches reports whether the active rebase is for branch, from tip onto onto. Both git rebase backends record these values in the worktree's git dir; a rebase started after an earlier one was aborted can differ in any of them. It only reads the state, leaving the rebase and index alone.\n\n```go\nfunc (c *Client) RebaseOnto(ctx context.Context, repo Repo, onto, upstream, branch string) (stopped bool, err error)\n```\nRebaseOnto runs \\`git rebase --onto onto upstream branch\\` without an editor. It checks branch out, so the working tree must be clean enough for git. stopped is true when git stopped on a conflict and left the rebase in progress for the caller to resolve; any other failure is an error.\n\n```go\nfunc (c *Client) Reflog(ctx context.Context, repo Repo, ref string) ([]string, error)\n```\nReflog lists every commit ref has pointed at that the reflog still remembers, newest first. A ref with no reflog, or no ref at all, gives nothing.\n\n```go\nfunc (c *Client) RemoteFor(ctx context.Context, repo Repo, branch string) string\n```\nRemoteFor is the remote a branch tracks (branch.\\\u003cname\u003e.remote), or origin when it tracks nothing.\n\n```go\nfunc (c *Client) RemoteURL(ctx context.Context, repo Repo, name string) (string, error)\n```\nRemoteURL is the URL git uses to fetch from the named remote, with url.\\\u003cbase\u003e.insteadOf rewriting applied (git remote get-url). It only reads config; nothing touches the network.\n\n```go\nfunc (c *Client) RenameBranch(ctx context.Context, repo Repo, from, to string) error\n```\nRenameBranch renames a local branch, its reflog and its config (the upstream included, which still names the old remote branch). git refuses when to already exists.\n\n```go\nfunc (c *Client) Replay(ctx context.Context, repo Repo, commits []string, onto string) (ReplayResult, error)\n```\nReplay recreates commits, oldest first, on top of onto. It never touches a working tree, the index or a ref: it only creates objects, so the caller decides what to do with Tip. A merge commit is replayed against its first parent, which linearises it. A commit whose changes are already in the new parent would come out empty and is dropped instead. A root commit is replayed with an empty merge base.\n\n```go\nfunc (c *Client) ResetHard(ctx context.Context, repo Repo, rev string) error\n```\nResetHard moves the checked out branch, the index and the tree to rev. git deletes an untracked file in the way of a tracked one; callers check with AddedPaths and Untracked first.\n\n```go\nfunc (c *Client) ResetKeep(ctx context.Context, repo Repo, rev string) error\n```\nResetKeep moves HEAD and the checked out branch to rev and updates the working tree, keeping local changes to files rev and HEAD agree on. git refuses, and nothing moves, when a locally changed file differs between the two. Staged new files are re-added afterwards because reset --keep drops them from the index; the caller refuses up front when the move adds the same path, so re-adding cannot clobber anything.\n\n```go\nfunc (c *Client) ResetSoft(ctx context.Context, repo Repo, rev string) error\n```\nResetSoft moves the checked out branch to rev, leaving the index and the working tree alone.\n\n```go\nfunc (c *Client) RevList(ctx context.Context, repo Repo, from, to string) ([]string, error)\n```\nRevList lists the commits reachable from to but not from, oldest first.\n\n```go\nfunc (c *Client) RevParse(ctx context.Context, repo Repo, rev string) (string, error)\n```\nRevParse resolves rev to a full object id.\n\n```go\nfunc (c *Client) Runner() exec.Runner\n```\nRunner exposes the underlying runner (used by adapters that run other tools with the same debug/TTY settings).\n\n```go\nfunc (c *Client) StagedDiff(ctx context.Context, repo Repo) (string, error)\n```\nStagedDiff returns the diff of the index against HEAD.\n\n```go\nfunc (c *Client) StagedPatch(ctx context.Context, repo Repo) (string, error)\n```\nStagedPatch returns the index against HEAD the way DiffCommit reads a commit.\n\n```go\nfunc (c *Client) Subject(ctx context.Context, repo Repo, rev string) (string, error)\n```\nSubject returns the first line of the commit message of rev.\n\n```go\nfunc (c *Client) Subjects(ctx context.Context, repo Repo, rev string, n int) ([]string, error)\n```\nSubjects returns the commit subjects of rev's history, newest first, at most n.\n\n```go\nfunc (c *Client) Switch(ctx context.Context, repo Repo, name string) error\n```\nSwitch checks out an existing branch.\n\n```go\nfunc (c *Client) SwitchDetached(ctx context.Context, repo Repo, rev string) error\n```\nSwitchDetached checks out rev with a detached HEAD.\n\n```go\nfunc (c *Client) Tip(ctx context.Context, repo Repo, ref string) (string, bool, error)\n```\nTip resolves a full ref name (refs/heads/x, refs/remotes/origin/x) to a commit id. ok is false when the ref does not exist.\n\n```go\nfunc (c *Client) TreeOf(ctx context.Context, repo Repo, rev string) (string, error)\n```\nTreeOf returns the tree of the commit rev.\n\n```go\nfunc (c *Client) Untracked(ctx context.Context, repo Repo) ([]string, error)\n```\nUntracked lists the untracked, non ignored files in repo's worktree, relative to its top level.\n\n```go\nfunc (c *Client) UpdateRefs(ctx context.Context, repo Repo, updates []RefUpdate) error\n```\nUpdateRefs applies every update in one transaction: all move or none do.\n\n```go\nfunc (c *Client) Version(ctx context.Context) (string, error)\n```\nVersion returns git's version as x.y.z (\"2.47.1\"; a vendor suffix such as \"(Apple Git-154)\" or \".windows.1\" is dropped).\n\n```go\nfunc (c *Client) Worktrees(ctx context.Context, repo Repo) ([]Worktree, error)\n```\nWorktrees lists the main checkout and every linked worktree.\n\n```go\ntype Commit struct {\n\tSHA     string\n\tSubject string\n}\n```\nCommit is a commit as a list shows it: its id and subject.\n\n```go\ntype CommitInfo struct {\n\tAuthor, Email string\n\t// Date is the author date in strict ISO 8601 (git's %aI).\n\tDate    string\n\tMessage string\n\tTree    string\n\t// Parent is the first parent, \"\" for a root commit.\n\tParent string\n}\n```\nCommitInfo is what it takes to recreate a commit somewhere else.\n\n```go\ntype CommitOptions struct {\n\t// Message paragraphs; each becomes a -m argument. Empty opens the editor\n\t// unless NoEdit is set.\n\tMessage []string\n\tAmend   bool\n\tNoEdit  bool\n\t// Edit forces the editor even with a message (or when amending).\n\tEdit        bool\n\tResetAuthor bool\n\tNoVerify    bool\n\t// AllowEmpty permits a commit with no changes.\n\tAllowEmpty bool\n}\n```\nCommitOptions controls Commit.\n\n```go\ntype ConfigEntry struct {\n\tKey   string\n\tValue string\n}\n```\nConfigEntry is one key/value pair.\n\n```go\ntype Conflict struct {\n\tCommit string\n\tFiles  []string\n}\n```\nConflict is a commit that could not be replayed cleanly.\n\n```go\ntype MergeTreeResult struct {\n\tTree      string\n\tConflicts []string\n}\n```\nMergeTreeResult is a three way merge computed without a working tree: the merged tree, and the conflicting paths when it was not clean (the tree then contains conflict markers and must not be committed).\n\n```go\ntype Option func(*Client)\n```\nOption configures a Client.\n\n```go\nfunc WithLockRetry(budget time.Duration, sleep func(context.Context, time.Duration) error) Option\n```\nWithLockRetry sets the retry budget for a held index lock and the function used to wait between attempts (tests pass a fake).\n\n```go\ntype OverwriteError struct {\n\tChanged, Untracked []string\n}\n```\nOverwriteError is git refusing to move a checkout because doing so would overwrite files in it: local changes to tracked files (Changed) and untracked files where the update writes (Untracked). Paths are relative to the checkout. git touched nothing.\n\n```go\nfunc (e *OverwriteError) Error() string\n```\n\n```go\ntype PatchError struct {\n\tDetail string\n}\n```\nPatchError is a patch git apply would not put on the tree as given: the lines it removes are not where it says, it applied them at an offset, or git rejected it for any other reason. Detail is git's output.\n\n```go\nfunc (e *PatchError) Error() string\n```\n\n```go\ntype PushLease struct {\n\tBranch string\n\tExpect string\n}\n```\nPushLease is a branch to push and the remote tip it may replace. An empty Expect means the branch must not exist on the remote yet.\n\n```go\ntype RefUpdate struct {\n\tRef, New, Old string\n}\n```\nRefUpdate moves Ref to New, or deletes it when New is empty. When Old is set the ref must currently be at Old, and the whole transaction fails if any Old is stale.\n\n```go\ntype ReplayResult struct {\n\t// Tip is the new tip (onto itself when there was nothing to replay), or\n\t// \"\" when Conflict is set.\n\tTip string\n\t// Replayed counts the commits recreated.\n\tReplayed int\n\t// Skipped counts the commits dropped because their changes were already\n\t// in the new parent, as git rebase drops them.\n\tSkipped int\n\t// Conflict is set when the replay stopped; the commits before it were\n\t// recreated as unreferenced objects and nothing else happened.\n\tConflict *Conflict\n}\n```\nReplayResult is what Replay produced.\n\n```go\ntype Repo struct {\n\t// TopLevel is the working tree root.\n\tTopLevel string\n\t// GitDir is the repository directory for this worktree\n\t// (e.g. .git or .git/worktrees/\u003cname\u003e).\n\tGitDir string\n\t// CommonDir is the shared repository directory (.git of the main worktree).\n\tCommonDir string\n}\n```\nRepo locates a repository. All paths are absolute.\n\n```go\nfunc (r Repo) IsLinkedWorktree() bool\n```\nIsLinkedWorktree reports whether the repo is a linked worktree.\n\n```go\ntype Scope int\n```\nScope selects which git config file an operation targets.\n\n```go\nconst (\n\t// ScopeMerged reads the effective value across all files (reads only).\n\tScopeMerged Scope = iota\n\t// ScopeGlobal targets the user's global config.\n\tScopeGlobal\n\t// ScopeLocal targets the repository config.\n\tScopeLocal\n)\n```\n\n```go\ntype SigningError struct {\n\t// Format is gpg.format: ssh, openpgp (the default) or x509.\n\tFormat string\n\t// Key is user.signingkey as configured, which for ssh is usually the\n\t// path of the public key file; empty when unset.\n\tKey string\n\t// Detail is git's stderr, including the signing program's output.\n\tDetail string\n}\n```\nSigningError reports that git could not sign a commit. Nothing was committed. From Commit the index is untouched; from a rebase (RebaseOnto, RebaseContinue) the rebase is left in progress with the failed pick's changes staged, for RebaseContinue to commit once signing works or RebaseAbort to drop.\n\n```go\nfunc (e *SigningError) Error() string\n```\n\n```go\ntype Worktree struct {\n\t// Path is the working tree root.\n\tPath string\n\tHead string\n\t// Branch is the checked out branch (short name), empty when detached or bare.\n\tBranch   string\n\tDetached bool\n\tBare     bool\n\t// Prunable is set when git would prune the entry, usually because its\n\t// directory has been deleted.\n\tPrunable bool\n\t// Locked is set when the entry is locked against pruning.\n\tLocked bool\n}\n```\nWorktree is one entry of \\`git worktree list\\`.\n\n","path":"github.com/DomBlack/git-stack/pkg/git","name":"git","synopsis":"Package git is a typed wrapper around the git command line.","isRedistributable":true}
