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 ¶
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 ¶
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 ¶
type DeletionSet map[string]struct{}
func (DeletionSet) Keys ¶
func (d DeletionSet) Keys() []string
type PathContent ¶
func (PathContent) Keys ¶
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 ¶
func (r *Repository) HeadCommit() (hash string)
func (*Repository) SetDefaults ¶
func (r *Repository) SetDefaults()
SetDefaults implements defaults.Setter interface
func (*Repository) Staged ¶
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) Tracked ¶
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.