| 146 | } |
| 147 | |
| 148 | func TestClientRemotesToleratesMissingResolutionConfig(t *testing.T) { |
| 149 | // Given a remote without resolution metadata |
| 150 | repo := newTestRepo(t) |
| 151 | repo.run(t, "remote", "add", "origin", "git@example.com:monalisa/origin.git") |
| 152 | |
| 153 | // When the remotes are listed |
| 154 | remotes, err := repo.client.Remotes(t.Context()) |
| 155 | |
| 156 | // Then Git's no-matching-config status is treated as an empty resolution |
| 157 | require.NoError(t, err) |
| 158 | require.Len(t, remotes, 1) |
| 159 | assert.Equal(t, "origin", remotes[0].Name) |
| 160 | assert.Empty(t, remotes[0].Resolved) |
| 161 | } |
| 162 | |
| 163 | func TestParseRemotes(t *testing.T) { |
| 164 | // Given remote output with fetch-only, push-only, paired, and mixed URL forms |