(repoPath string)
| 61 | } |
| 62 | |
| 63 | func ensureRepoRoot(repoPath string) (string, error) { |
| 64 | if _, err := os.Stat(repoPath); os.IsNotExist(err) { |
| 65 | return "", fmt.Errorf("repository path does not exist: %s", repoPath) |
| 66 | } |
| 67 | if !isGitRepository(repoPath) { |
| 68 | return "", fmt.Errorf("%s is not a git repository (use 'git init' to initialize)", repoPath) |
| 69 | } |
| 70 | |
| 71 | repoRoot, err := GetRepositoryRoot(repoPath) |
| 72 | if err != nil { |
| 73 | return "", fmt.Errorf("failed to get repository root: %w", err) |
| 74 | } |
| 75 | return filepath.Clean(repoRoot), nil |
| 76 | } |
| 77 | |
| 78 | func parseNullSeparatedPaths(stdout []byte) []string { |
| 79 | parts := strings.Split(string(stdout), "\x00") |
no test coverage detected