Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,12 @@ type gitignoreSeq struct {
func (s gitignoreSeq) run(t *testing.T) {
t.Helper()
cleanup := func() {
// The fixture manages its own .git marker so that gitignore filtering
// resolves a repo root regardless of the build source: an in-tree
// checkout would otherwise inherit the go-task .git, but a GitHub
// source tarball has none, which would silently disable filtering and
// break the golden fixtures.
_ = os.RemoveAll(filepathext.SmartJoin(s.dir, ".git"))
_ = os.RemoveAll(filepathext.SmartJoin(s.dir, ".task"))
for name := range s.create {
_ = os.Remove(filepathext.SmartJoin(s.dir, name))
Expand All @@ -694,6 +700,7 @@ func (s gitignoreSeq) run(t *testing.T) {
}
cleanup()
t.Cleanup(cleanup)
require.NoError(t, os.MkdirAll(filepathext.SmartJoin(s.dir, ".git"), 0o755))
for name, content := range s.create {
writeFile(t, s.dir, name, content)
}
Expand Down
Loading