MCPcopy Create free account
hub / github.com/JordanCoin/codemap / TestGitIgnoreCacheNil

Function TestGitIgnoreCacheNil

scanner/walker_test.go:328–349  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

326}
327
328func TestGitIgnoreCacheNil(t *testing.T) {
329 // Test that ScanFiles works with nil cache (no gitignore)
330 tmpDir := t.TempDir()
331
332 if err := os.WriteFile(filepath.Join(tmpDir, "file.go"), []byte("package main"), 0644); err != nil {
333 t.Fatal(err)
334 }
335 if err := os.WriteFile(filepath.Join(tmpDir, "file.log"), []byte("log"), 0644); err != nil {
336 t.Fatal(err)
337 }
338
339 // Scan without gitignore cache
340 files, err := ScanFiles(tmpDir, nil, nil, nil)
341 if err != nil {
342 t.Fatalf("ScanFiles failed: %v", err)
343 }
344
345 // Should include both files
346 if len(files) != 2 {
347 t.Errorf("Expected 2 files, got %d", len(files))
348 }
349}
350
351// TestNestedGitignoreMonorepo simulates the issue #6 scenario:
352// A monorepo with multiple projects, each with their own .gitignore

Callers

nothing calls this directly

Calls 1

ScanFilesFunction · 0.85

Tested by

no test coverage detected