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

Function ListTrackedFiles

vcs/git/git_ls_files.go:11–23  ·  view source on GitHub ↗

ListTrackedFiles returns absolute paths for files tracked in the git index.

(repoPath string)

Source from the content-addressed store, hash-verified

9
10// ListTrackedFiles returns absolute paths for files tracked in the git index.
11func ListTrackedFiles(repoPath string) ([]string, error) {
12 repoRoot, err := ensureRepoRoot(repoPath)
13 if err != nil {
14 return nil, err
15 }
16
17 stdout, stderr, err := runGitCommand(repoPath, "ls-files", "-z", "--cached")
18 if err != nil {
19 return nil, gitCommandError(err, stderr)
20 }
21
22 return toAbsolutePaths(repoRoot, parseNullSeparatedPaths(stdout)), nil
23}
24
25// ListUntrackedFiles returns absolute paths for non-ignored untracked files.
26func ListUntrackedFiles(repoPath string) ([]string, error) {

Callers 1

Calls 5

ensureRepoRootFunction · 0.85
runGitCommandFunction · 0.85
gitCommandErrorFunction · 0.85
toAbsolutePathsFunction · 0.85
parseNullSeparatedPathsFunction · 0.85

Tested by

no test coverage detected