(t *testing.T)
| 1767 | } |
| 1768 | |
| 1769 | func TestClientRemoteURLSeparatesRemoteNameFromOptions(t *testing.T) { |
| 1770 | // Given a configured remote whose name resembles a Git option |
| 1771 | repo := newTestRepo(t) |
| 1772 | repo.run(t, "config", "remote.--upload-pack=malicious.url", "https://example.com/repo.git") |
| 1773 | |
| 1774 | // When the remote URL is requested |
| 1775 | remoteURL, err := repo.client.RemoteURL(t.Context(), "--upload-pack=malicious") |
| 1776 | |
| 1777 | // Then an option separator protects the remote name |
| 1778 | require.NoError(t, err) |
| 1779 | assert.Equal(t, "https://example.com/repo.git", remoteURL) |
| 1780 | } |
| 1781 | |
| 1782 | func TestClientRemoteURLReportsMissingGitExecutable(t *testing.T) { |
| 1783 | // Given Git cannot be resolved |
nothing calls this directly
no test coverage detected