MCPcopy Create free account
hub / github.com/go-task/task / TestGitignoreNegation

Function TestGitignoreNegation

task_test.go:730–742  ·  view source on GitHub ↗

TestGitignoreNegation checks that a `!pattern` in a nested .gitignore re-includes a file excluded by a parent .gitignore.

(t *testing.T)

Source from the content-addressed store, hash-verified

728// TestGitignoreNegation checks that a `!pattern` in a nested .gitignore
729// re-includes a file excluded by a parent .gitignore.
730func TestGitignoreNegation(t *testing.T) { //nolint:paralleltest // mutates fixture files
731 gitignoreSeq{
732 dir: "testdata/gitignore_negation",
733 task: "build",
734 create: map[string]string{"sub/debug.log": "debug\n", "sub/other.log": "other\n"},
735 steps: []gitignoreStep{
736 {run: "first run"},
737 {run: "up to date"},
738 {run: "ignored file modified", write: map[string]string{"sub/other.log": "other modified\n"}},
739 {run: "reincluded file modified", write: map[string]string{"sub/debug.log": "debug modified\n"}},
740 },
741 }.run(t)
742}
743
744// TestGitignoreNested checks that a .gitignore in a subdirectory below the task
745// dir is honored when its files are reached by a deep glob.

Callers

nothing calls this directly

Calls 1

runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…