MCPcopy Create free account
hub / github.com/cli/cli / TestClientIsIgnoredReportsFatalGitError

Function TestClientIsIgnoredReportsFatalGitError

git/client_test.go:1820–1834  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1818}
1819
1820func 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
1836func TestClientIsIgnoredSeparatesPathFromOptions(t *testing.T) {
1837 // Given an ignored path that resembles a Git option

Callers

nothing calls this directly

Calls 4

IsIgnoredMethod · 0.95
newTestRepoFunction · 0.85
JoinMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected