(t *testing.T)
| 1076 | } |
| 1077 | |
| 1078 | func TestClientToplevelDirReportsNonRepository(t *testing.T) { |
| 1079 | // Given a client outside a Git repository |
| 1080 | IsolateConfig(t) |
| 1081 | client := Client{RepoDir: t.TempDir()} |
| 1082 | |
| 1083 | // When the top-level directory is requested |
| 1084 | dir, err := client.ToplevelDir(t.Context()) |
| 1085 | |
| 1086 | // Then Git's repository error is returned |
| 1087 | require.Error(t, err) |
| 1088 | var gitError *GitError |
| 1089 | require.ErrorAs(t, err, &gitError) |
| 1090 | assert.Equal(t, 128, gitError.ExitCode) |
| 1091 | assert.Empty(t, dir) |
| 1092 | } |
| 1093 | |
| 1094 | func TestClientGitDirReturnsRepositoryMetadataDirectory(t *testing.T) { |
| 1095 | // Given a local Git repository |
nothing calls this directly
no test coverage detected