(t *testing.T)
| 1223 | } |
| 1224 | |
| 1225 | func TestClientFetchReportsMissingRef(t *testing.T) { |
| 1226 | // Given a repository connected to an empty local remote |
| 1227 | repo := newTestRepo(t) |
| 1228 | repo.run(t, "remote", "add", "origin", newBareTestRepo(t).fileURL()) |
| 1229 | |
| 1230 | // When a missing ref is fetched |
| 1231 | err := repo.client.Fetch(t.Context(), "origin", "missing") |
| 1232 | |
| 1233 | // Then Git reports a semantic command failure |
| 1234 | require.Error(t, err) |
| 1235 | var gitErr *GitError |
| 1236 | require.ErrorAs(t, err, &gitErr) |
| 1237 | assert.NotZero(t, gitErr.ExitCode) |
| 1238 | } |
| 1239 | |
| 1240 | func TestClientFetchUsesAuthenticatedCommand(t *testing.T) { |
| 1241 | // Given a client that records the Git command |
nothing calls this directly
no test coverage detected