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

Function collectCommitFilePaths

cmd/show/show_cmd.go:746–766  ·  view source on GitHub ↗
(opts *graphOptions, fromCommit, toCommit string, isCommitRange bool)

Source from the content-addressed store, hash-verified

744}
745
746func collectCommitFilePaths(opts *graphOptions, fromCommit, toCommit string, isCommitRange bool) ([]string, error) {
747 if isCommitRange {
748 filePaths, err := git.GetCommitRangeFiles(opts.repoPath, fromCommit, toCommit)
749 if err != nil {
750 return nil, fmt.Errorf("failed to get files from commit range: %w", err)
751 }
752 if len(filePaths) == 0 {
753 return nil, fmt.Errorf("no files changed in commit range %s", opts.commitID)
754 }
755 return filePaths, nil
756 }
757
758 filePaths, err := git.GetCommitDartFiles(opts.repoPath, toCommit)
759 if err != nil {
760 return nil, fmt.Errorf("failed to get files from commit: %w", err)
761 }
762 if len(filePaths) == 0 {
763 return nil, fmt.Errorf("no files changed in commit %s", toCommit)
764 }
765 return filePaths, nil
766}
767
768// isPlainCommitView reports whether this is a bare `-c <commit>` view, as opposed
769// to one narrowed by positional paths, --between, or --reach. Only the plain view

Callers 1

determineFilePathsFunction · 0.85

Calls 2

GetCommitRangeFilesFunction · 0.92
GetCommitDartFilesFunction · 0.92

Tested by

no test coverage detected