Documentation
¶
Index ¶
- Variables
- func ParseCopySpec(spec, separator string) (branch, source, target string, err error)
- func ParseUpdateSpec(spec, separator string) (source, target string, err error)
- type DeletionSet
- type PathContent
- type Repository
- func (r *Repository) HeadCommit() (hash string)
- func (r *Repository) SetDefaults()
- func (r *Repository) Staged(gitStatus git.Status) (pathContent PathContent, deletionSet DeletionSet, err error)
- func (r *Repository) Status() (status git.Status, err error)
- func (r *Repository) Tracked(gitStatus git.Status) (pathContent PathContent, deletionSet DeletionSet, err error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidSpec = errors.New("invalid spec") ErrNoBranchSpec = errors.New("empty branch spec") ErrInvalidBranchName = errors.New("invalid branch spec") ErrEmptySourceSpec = errors.New("empty source spec") ErrEmptyTargetSpec = errors.New("empty target spec") ErrSourceEqualsTarget = errors.New("source and target files are the same") )
Functions ¶
func ParseCopySpec ¶ added in v0.13.0
ParseCopySpec parses a file specification into remote source andtarget file paths. The separator is used to split the source and target file paths. All file paths are cleaned before being returned.
func ParseUpdateSpec ¶ added in v0.13.0
ParseUpdateSpec parses a file specification into source and target file paths. The separator is used to split the source and target file paths, if present. All file paths are cleaned before being returned.
Types ¶
type DeletionSet ¶ added in v0.13.0
type DeletionSet map[string]struct{}
func (DeletionSet) Keys ¶ added in v0.13.0
func (d DeletionSet) Keys() []string
type PathContent ¶ added in v0.13.0
func (PathContent) Keys ¶ added in v0.13.0
func (p PathContent) Keys() []string
type Repository ¶
type Repository struct {
Repository *git.Repository `json:"-"`
Owner string `json:"owner"`
Name string `json:"name"`
Path string `json:"path" default:"."`
Branch string `json:"branch" default:"main"`
User struct {
Name string `json:"name"`
Email string `json:"email"`
} `json:"user"`
}
func (*Repository) HeadCommit ¶ added in v0.3.0
func (r *Repository) HeadCommit() (hash string)
func (*Repository) SetDefaults ¶ added in v0.13.0
func (r *Repository) SetDefaults()
SetDefaults implements defaults.Setter interface
func (*Repository) Staged ¶ added in v0.13.0
func (r *Repository) Staged(gitStatus git.Status) ( pathContent PathContent, deletionSet DeletionSet, err error, )
Staged returns all changes to staged files in the repository. If the file is added or modified, the contents are read from the git index.
func (*Repository) Status ¶ added in v0.3.0
func (r *Repository) Status() (status git.Status, err error)
func (*Repository) Tracked ¶ added in v0.13.0
func (r *Repository) Tracked(gitStatus git.Status) ( pathContent PathContent, deletionSet DeletionSet, err error, )
Tracked returns all changes to tracked files in the repository. If the file is added or modified, the contents are read from the filesystem.