Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentBranch ¶
CurrentBranch returns the current branch name when dir is the root of a Git repository. Returns empty string if dir is not a repo, git is unavailable, or on error.
Types ¶
type ChangeStatus ¶
type ChangeStatus string
const ( StatusAdded ChangeStatus = "added" StatusModified ChangeStatus = "modified" StatusDeleted ChangeStatus = "deleted" StatusRenamed ChangeStatus = "renamed" )
type ChangedFile ¶
type ChangedFile struct {
Path string `json:"path"`
OldPath string `json:"old_path,omitempty"`
Status ChangeStatus `json:"status"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
Patch string `json:"patch,omitempty"`
Binary bool `json:"binary,omitempty"`
Truncated bool `json:"truncated,omitempty"`
}
type WorkspaceDiff ¶
type WorkspaceDiff struct {
Workspace string `json:"workspace"`
Files []ChangedFile `json:"files"`
Error string `json:"error,omitempty"`
}
func ReadWorkspace ¶
func ReadWorkspace(ctx context.Context, workspace string) (WorkspaceDiff, error)
Click to show internal directories.
Click to hide internal directories.