(t *testing.T)
| 302 | } |
| 303 | |
| 304 | func TestClientShowRefsSeparatesRefsFromOptions(t *testing.T) { |
| 305 | // Given a repository with one branch |
| 306 | repo := newTestRepo(t) |
| 307 | repo.run(t, "commit", "--quiet", "--allow-empty", "-m", "initial commit") |
| 308 | wantHash := repo.run(t, "rev-parse", "HEAD") |
| 309 | |
| 310 | // When the branch and an option-like ref are resolved |
| 311 | refs, err := repo.client.ShowRefs(t.Context(), []string{"refs/heads/trunk", "--quiet"}) |
| 312 | |
| 313 | // Then an option separator protects the refs, so the branch resolves and the option-like ref is rejected |
| 314 | require.Error(t, err) |
| 315 | var gitError *GitError |
| 316 | require.ErrorAs(t, err, &gitError) |
| 317 | assert.NotZero(t, gitError.ExitCode) |
| 318 | assert.Equal(t, []Ref{{Hash: wantHash, Name: "refs/heads/trunk"}}, refs) |
| 319 | } |
| 320 | |
| 321 | func TestClientConfigReturnsConfiguredValue(t *testing.T) { |
| 322 | // Given a repository with a configured credential helper |
nothing calls this directly
no test coverage detected