(opts *graphOptions, fromCommit, toCommit string, isCommitRange bool)
| 744 | } |
| 745 | |
| 746 | func 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 |
no test coverage detected