Documentation
¶
Overview ¶
Package repo handles DVC repository discovery and well-known paths.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not a DVC repository (no .dvc directory found)")
ErrNotFound is returned when no .dvc directory is found.
Functions ¶
func GitAdd ¶
GitAdd stages the given paths in the git repo at dir, mirroring what DVC does after init.
func InGitWorkTree ¶
InGitWorkTree reports whether dir is inside a git work tree. It shells out to git, which is only consulted in scm mode (the standalone --no-scm path never calls this).
func InitRepo ¶
func InitRepo(root string, mode InitMode) (*Repo, InitOutcome, error)
InitRepo creates a .dvc repository structure byte-compatible with what `dvc init` (ModeSCM) or `dvc init --no-scm` (ModeNoSCM) produces. It does not create the cache directory (DVC creates it lazily on the first add). It is safe: if the directory already has a repo, or sits inside one, it reports the outcome without modifying anything.
Types ¶
type Config ¶
Config is the parsed .dvc/config.
func LoadConfig ¶
LoadConfig parses .dvc/config. A missing file yields defaults.
type InitOutcome ¶
type InitOutcome int
InitOutcome reports what InitRepo did.
const ( Created InitOutcome = iota // structure created AlreadyInitialized // .dvc/ already exists in root InsideExistingRepo // an ancestor already has a .dvc/ )
type Remote ¶
type Remote struct {
Name string
URL string
EndpointURL string
Region string
AccessKeyID string
SecretAccessKey string
SessionToken string
Profile string
}
Remote is a configured storage remote (S3-compatible in the MVP).