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

Function inFiles

worktree.go:440–444  ·  view source on GitHub ↗

inFiles checks if the given file is in the list of files. The incoming filepaths in files should be cleaned before calling this function.

(files map[string]struct{}, v string)

Source from the content-addressed store, hash-verified

438
439// inFiles checks if the given file is in the list of files. The incoming filepaths in files should be cleaned before calling this function.
440func inFiles(files map[string]struct{}, v string) bool {
441 v = filepath.Clean(v)
442 _, exists := files[v]
443 return exists
444}
445
446func (w *Worktree) resetWorktree(t *object.Tree, files []string) error {
447 changes, err := w.diffStagingWithWorktree(true, false)

Callers 2

resetIndexMethod · 0.85
resetWorktreeMethod · 0.85

Calls 1

CleanMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…