(t *testing.T)
| 316 | } |
| 317 | |
| 318 | func TestInferGitRepoRoot_InNestedDir(t *testing.T) { |
| 319 | tempDir, _ := setupTestRepository(t) |
| 320 | |
| 321 | nested := filepath.Join(tempDir, "nested", "deep") |
| 322 | err := os.MkdirAll(nested, 0o755) |
| 323 | require.NoError(t, err, "failed to create nested directories") |
| 324 | |
| 325 | root, err := InferGitRepoRoot(nested) |
| 326 | require.NoError(t, err, "InferGitRepoRoot failed on nested path") |
| 327 | assertPathsEqual(t, root, tempDir) |
| 328 | } |
| 329 | |
| 330 | func TestInferGitRepoRoot_NotRepo(t *testing.T) { |
| 331 | dir := t.TempDir() |
nothing calls this directly
no test coverage detected