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

Function GitCommitContentReader

vcs/git/git_commit_content_reader.go:10–15  ·  view source on GitHub ↗

GitCommitContentReader returns a ContentReader that reads file content from a specific git commit.

(repoPath, commitID string)

Source from the content-addressed store, hash-verified

8
9// GitCommitContentReader returns a ContentReader that reads file content from a specific git commit.
10func GitCommitContentReader(repoPath, commitID string) vcs.ContentReader {
11 return func(absPath string) ([]byte, error) {
12 relPath := getRelativePath(absPath, repoPath)
13 return GetFileContentFromCommit(repoPath, commitID, relPath)
14 }
15}
16
17// GetRelativePath converts an absolute file path to a path relative to the repository root
18func getRelativePath(absPath, repoPath string) string {

Callers 5

runGraphFunction · 0.92
loadDeletedFileContentFunction · 0.92
annotateRustPhantomsFunction · 0.92
ContentReaderMethod · 0.92
buildGraphFunction · 0.92

Calls 2

getRelativePathFunction · 0.85
GetFileContentFromCommitFunction · 0.85

Tested by

no test coverage detected