Documentation ¶
Overview ¶
Package gitstatus provides information about the git status of a working tree.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Porcelain ¶ added in v0.4.0
type Porcelain struct { // NumModified is the number of modified files. NumModified int // NumConflicts is the number of unmerged files. NumConflicts int // NumUntracked is the number of untracked files. NumUntracked int // NumStaged is the number of staged files. NumStaged int // IsDetached reports whether HEAD is not associated to any branch // (detached). IsDetached bool // IsInitial reports whether the working tree is in its initial state (no // commit have been performed yet). IsInitial bool // LocalBranch is the name of the local branch. LocalBranch string // RemoteBranch is the name of upstream remote branch (tracking). RemoteBranch string // AheadCount reports by how many commits the local branch is ahead of its upstream branch. AheadCount int // BehindCount reports by how many commits the local branch is behind its upstream branch. BehindCount int }
Porcelain holds the Git status variables extracted from calling git status --porcelain.
type Status ¶
type Status struct { Porcelain // NumStashed is the number of stash entries. NumStashed int // HEAD is the shortened SHA1 of current commit (empty in initial state). HEAD string // State indicates the state of the working tree. State TreeState // IsClean reports whether the working tree is in a clean state (i.e empty // staging area, no conflicts and no untracked files). IsClean bool // Insertions is the count of inserted lines in the staging area. Insertions int // Deletions is the count of deleted lines in the staging area. Deletions int }
Status represents the status of a Git working tree directory.
type TreeState ¶
type TreeState int
TreeState indicates the state of a Git working tree. Its zero-value is NormalState.
const ( // Default is state set when the working tree is not in any special state. Default TreeState = iota // Rebasing is the state set when a rebase is in progress, either // interactive or manual. Rebasing // AM is the state set when a git AM is in progress (mailbox patch). AM // AMRebase is the state set when a git AM rebasing is in progress. AMRebase // Merging is the state set when a merge is in progress. Merging // CherryPicking is the state when a cherry-pick is in progress. CherryPicking // Reverting is the state when a revert is in progress. Reverting // Bisecting is the state when a bisect is in progress. Bisecting )
func (TreeState) MarshalJSON ¶
MarshalJSON returns the JSON encoding of the tree state.
Click to show internal directories.
Click to hide internal directories.