(t *testing.T)
| 1177 | } |
| 1178 | |
| 1179 | func TestClientSetRemoteBranchesLimitsTrackedBranches(t *testing.T) { |
| 1180 | // Given a repository that fetches every branch from a local remote |
| 1181 | repo := newTestRepo(t) |
| 1182 | repo.run(t, "remote", "add", "origin", newBareTestRepo(t).fileURL()) |
| 1183 | |
| 1184 | // When the tracked remote branches are limited to trunk |
| 1185 | err := repo.client.SetRemoteBranches(t.Context(), "origin", "trunk") |
| 1186 | |
| 1187 | // Then only the trunk remote-tracking ref is configured |
| 1188 | require.NoError(t, err) |
| 1189 | assert.Equal(t, "+refs/heads/trunk:refs/remotes/origin/trunk", repo.run(t, "config", "--get-all", "remote.origin.fetch")) |
| 1190 | } |
| 1191 | |
| 1192 | func TestClientSetRemoteBranchesReportsMissingRemote(t *testing.T) { |
| 1193 | // Given a repository without the named remote |
nothing calls this directly
no test coverage detected