(t *testing.T)
| 1533 | } |
| 1534 | |
| 1535 | func TestClientAddRemoteTracksSpecificBranches(t *testing.T) { |
| 1536 | // Given a repository and a local bare remote |
| 1537 | repo := newTestRepo(t) |
| 1538 | remoteURL := newBareTestRepo(t).fileURL() |
| 1539 | |
| 1540 | // When the remote is added with specific tracking branches |
| 1541 | remote, err := repo.client.AddRemote(t.Context(), "test", remoteURL, []string{"trunk", "dev"}) |
| 1542 | |
| 1543 | // Then Git stores one fetch refspec for each requested branch |
| 1544 | require.NoError(t, err) |
| 1545 | assert.Equal(t, "test", remote.Name) |
| 1546 | assert.Equal(t, remoteURL, repo.run(t, "remote", "get-url", "test")) |
| 1547 | assert.Equal(t, "+refs/heads/trunk:refs/remotes/test/trunk\n+refs/heads/dev:refs/remotes/test/dev", repo.run(t, "config", "--get-all", "remote.test.fetch")) |
| 1548 | } |
| 1549 | |
| 1550 | type testRepo struct { |
| 1551 | dir string |
nothing calls this directly
no test coverage detected