MCPcopy Create free account
hub / github.com/go-git/go-git / AddOptions

Struct AddOptions

options.go:492–509  ·  view source on GitHub ↗

AddOptions describes how an `add` operation should be performed

Source from the content-addressed store, hash-verified

490
491// AddOptions describes how an `add` operation should be performed
492type AddOptions struct {
493 // All equivalent to `git add -A`, update the index not only where the
494 // working tree has a file matching `Path` but also where the index already
495 // has an entry. This adds, modifies, and removes index entries to match the
496 // working tree. If no `Path` nor `Glob` is given when `All` option is
497 // used, all files in the entire working tree are updated.
498 All bool
499 // Path is the exact filepath to the file or directory to be added.
500 Path string
501 // Glob adds all paths, matching pattern, to the index. If pattern matches a
502 // directory path, all directory contents are added to the index recursively.
503 Glob string
504 // SkipStatus adds the path with no status check. This option is relevant only
505 // when the `Path` option is specified and does not apply when the `All` option is used.
506 // Notice that when passing an ignored path it will be added anyway.
507 // When true it can speed up adding files to the worktree in very large repositories.
508 SkipStatus bool
509}
510
511// Validate validates the fields and sets the default values.
512func (o *AddOptions) Validate(r *Repository) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected