(t *testing.T)
| 1517 | } |
| 1518 | |
| 1519 | func TestClientAddRemoteTracksAllBranches(t *testing.T) { |
| 1520 | // Given a repository and a local bare remote |
| 1521 | repo := newTestRepo(t) |
| 1522 | remoteURL := newBareTestRepo(t).fileURL() |
| 1523 | |
| 1524 | // When the remote is added without branch restrictions |
| 1525 | remote, err := repo.client.AddRemote(t.Context(), "test", remoteURL, nil) |
| 1526 | |
| 1527 | // Then Git stores the remote and its all-branches fetch refspec |
| 1528 | require.NoError(t, err) |
| 1529 | assert.Equal(t, "test", remote.Name) |
| 1530 | assert.Equal(t, remoteURL, remote.FetchURL.String()) |
| 1531 | assert.Equal(t, remoteURL, repo.run(t, "remote", "get-url", "test")) |
| 1532 | assert.Equal(t, "+refs/heads/*:refs/remotes/test/*", repo.run(t, "config", "--get-all", "remote.test.fetch")) |
| 1533 | } |
| 1534 | |
| 1535 | func TestClientAddRemoteTracksSpecificBranches(t *testing.T) { |
| 1536 | // Given a repository and a local bare remote |
nothing calls this directly
no test coverage detected