(t *testing.T)
| 1104 | } |
| 1105 | |
| 1106 | func TestClientGitDirReportsNonRepository(t *testing.T) { |
| 1107 | // Given a client outside a Git repository |
| 1108 | IsolateConfig(t) |
| 1109 | client := Client{RepoDir: t.TempDir()} |
| 1110 | |
| 1111 | // When the Git metadata directory is requested |
| 1112 | dir, err := client.GitDir(t.Context()) |
| 1113 | |
| 1114 | // Then Git's repository error is returned |
| 1115 | require.Error(t, err) |
| 1116 | var gitError *GitError |
| 1117 | require.ErrorAs(t, err, &gitError) |
| 1118 | assert.Equal(t, 128, gitError.ExitCode) |
| 1119 | assert.Empty(t, dir) |
| 1120 | } |
| 1121 | |
| 1122 | func TestClientPathFromRootReturnsNestedPath(t *testing.T) { |
| 1123 | // Given a client operating from a nested repository directory |
nothing calls this directly
no test coverage detected