MCPcopy
hub / github.com/go-git/go-git / buildFilePathMap

Function buildFilePathMap

worktree.go:1103–1112  ·  view source on GitHub ↗

buildFilePathMap creates a map of cleaned file paths for efficient lookup. Returns nil if the input slice is empty.

(files []string)

Source from the content-addressed store, hash-verified

1101// buildFilePathMap creates a map of cleaned file paths for efficient lookup.
1102// Returns nil if the input slice is empty.
1103func buildFilePathMap(files []string) map[string]struct{} {
1104 if len(files) == 0 {
1105 return nil
1106 }
1107 filesMap := make(map[string]struct{}, len(files))
1108 for _, f := range files {
1109 filesMap[filepath.Clean(f)] = struct{}{}
1110 }
1111 return filesMap
1112}

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…