(t *testing.T)
| 1818 | } |
| 1819 | |
| 1820 | func TestClientIsIgnoredReportsFatalGitError(t *testing.T) { |
| 1821 | // Given a non-repository directory nested inside a repository |
| 1822 | repo := newTestRepo(t) |
| 1823 | dir := filepath.Join(repo.dir, "not-a-repository") |
| 1824 | require.NoError(t, os.Mkdir(dir, 0700)) |
| 1825 | t.Setenv("GIT_CEILING_DIRECTORIES", repo.dir) |
| 1826 | client := Client{RepoDir: dir} |
| 1827 | |
| 1828 | // When a path is checked |
| 1829 | ignored, err := client.IsIgnored(t.Context(), ".github/skills") |
| 1830 | |
| 1831 | // Then Git's fatal error is returned |
| 1832 | require.Error(t, err) |
| 1833 | assert.False(t, ignored, "a fatal Git error must not report the path as ignored") |
| 1834 | } |
| 1835 | |
| 1836 | func TestClientIsIgnoredSeparatesPathFromOptions(t *testing.T) { |
| 1837 | // Given an ignored path that resembles a Git option |
nothing calls this directly
no test coverage detected