local

package
v0.18.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func ParseCopySpec(spec, separator string) (branch, source, target string, err error)

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

func ParseUpdateSpec(spec, separator string) (source, target string, err error)

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

type PathContent map[string][]byte

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL