MCPcopy Create free account
hub / github.com/LegacyCodeHQ/clarity-cli / normalizeFilePaths

Function normalizeFilePaths

vcs/git/git_test_helpers.go:86–98  ·  view source on GitHub ↗

normalizeFilePaths normalizes file paths for golden file comparison by replacing the temp directory with $REPO placeholder

(tmpDir string, paths []string)

Source from the content-addressed store, hash-verified

84// normalizeFilePaths normalizes file paths for golden file comparison
85// by replacing the temp directory with $REPO placeholder
86func normalizeFilePaths(tmpDir string, paths []string) string {
87 if len(paths) == 0 {
88 return "(empty)"
89 }
90 resolvedTmpDir, _ := filepath.EvalSymlinks(tmpDir)
91 var normalized []string
92 for _, p := range paths {
93 relPath := strings.TrimPrefix(p, resolvedTmpDir+"/")
94 normalized = append(normalized, "$REPO/"+relPath)
95 }
96 sort.Strings(normalized)
97 return strings.Join(normalized, "\n")
98}
99
100// normalizeFileStats normalizes file stats for golden file comparison
101func normalizeFileStats(tmpDir string, stats map[string]vcs.FileStats) string {

Calls

no outgoing calls