(t *testing.T)
| 1834 | } |
| 1835 | |
| 1836 | func TestClientIsIgnoredSeparatesPathFromOptions(t *testing.T) { |
| 1837 | // Given an ignored path that resembles a Git option |
| 1838 | repo := newTestRepo(t) |
| 1839 | require.NoError(t, os.WriteFile(filepath.Join(repo.dir, ".gitignore"), []byte("--no-index\n"), 0600)) |
| 1840 | require.NoError(t, os.WriteFile(filepath.Join(repo.dir, "--no-index"), nil, 0600)) |
| 1841 | |
| 1842 | // When the path is checked |
| 1843 | ignored, err := repo.client.IsIgnored(t.Context(), "--no-index") |
| 1844 | |
| 1845 | // Then an option separator protects the path |
| 1846 | require.NoError(t, err) |
| 1847 | assert.True(t, ignored, "expected option-like path to match its ignore rule") |
| 1848 | } |
| 1849 | |
| 1850 | func TestClientIsIgnoredReportsMissingGitExecutable(t *testing.T) { |
| 1851 | // Given Git cannot be resolved |
nothing calls this directly
no test coverage detected