Skip to content

Commit ea9cbe3

Browse files
committed
check for empty repo root
1 parent 89f8b19 commit ea9cbe3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/cli_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ func sanitizeOutput(output string) (string, error) {
186186
if err != nil {
187187
return "", err
188188
}
189+
if repoRoot == "" {
190+
return "", errors.New("failed to determine repository root")
191+
}
189192
// Replace all instances of the repo root with the placeholder.
190193
return strings.ReplaceAll(output, repoRoot, "/absolute/path/to/repo"), nil
191194
}

0 commit comments

Comments
 (0)