Skip to content

Commit

Permalink
check for empty repo root
Browse files Browse the repository at this point in the history
  • Loading branch information
osterman committed Feb 3, 2025
1 parent 89f8b19 commit ea9cbe3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ func sanitizeOutput(output string) (string, error) {
if err != nil {
return "", err
}
if repoRoot == "" {
return "", errors.New("failed to determine repository root")
}
// Replace all instances of the repo root with the placeholder.
return strings.ReplaceAll(output, repoRoot, "/absolute/path/to/repo"), nil
}
Expand Down

0 comments on commit ea9cbe3

Please sign in to comment.