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

Function TestClientIsIgnoredReturnsTrueForIgnoredPath

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

Source from the content-addressed store, hash-verified

1793}
1794
1795func TestClientIsIgnoredReturnsTrueForIgnoredPath(t *testing.T) {
1796 // Given a repository that ignores the requested path
1797 repo := newTestRepo(t)
1798 require.NoError(t, os.WriteFile(filepath.Join(repo.dir, ".gitignore"), []byte(".github/skills\n"), 0600))
1799
1800 // When the path is checked
1801 ignored, err := repo.client.IsIgnored(t.Context(), ".github/skills")
1802
1803 // Then it is reported as ignored
1804 require.NoError(t, err)
1805 assert.True(t, ignored, "expected configured ignore rule to match")
1806}
1807
1808func TestClientIsIgnoredReturnsFalseForUnignoredPath(t *testing.T) {
1809 // Given a repository without an ignore rule for the requested path

Callers

nothing calls this directly

Calls 4

newTestRepoFunction · 0.85
WriteFileMethod · 0.80
JoinMethod · 0.80
IsIgnoredMethod · 0.80

Tested by

no test coverage detected