@@ -1381,47 +1381,6 @@ func TestFilesystemTool_SearchContent_WithGitignore(t *testing.T) {
13811381 assert .NotContains (t , result .Output , "debug.log" )
13821382}
13831383
1384- func TestFilesystemTool_NestedGitignore (t * testing.T ) {
1385- tmpDir := t .TempDir ()
1386-
1387- // Initialize git repository
1388- initGitRepo (t , tmpDir )
1389-
1390- // Create root .gitignore
1391- require .NoError (t , os .WriteFile (filepath .Join (tmpDir , ".gitignore" ), []byte ("*.log\n " ), 0o644 ))
1392-
1393- // Create subdirectory with its own .gitignore
1394- subDir := filepath .Join (tmpDir , "subdir" )
1395- require .NoError (t , os .Mkdir (subDir , 0o755 ))
1396- require .NoError (t , os .WriteFile (filepath .Join (subDir , ".gitignore" ), []byte ("*.tmp\n " ), 0o644 ))
1397-
1398- // Create files
1399- require .NoError (t , os .WriteFile (filepath .Join (tmpDir , "root.txt" ), []byte ("test" ), 0o644 ))
1400- require .NoError (t , os .WriteFile (filepath .Join (tmpDir , "root.log" ), []byte ("log" ), 0o644 ))
1401- require .NoError (t , os .WriteFile (filepath .Join (subDir , "sub.txt" ), []byte ("test" ), 0o644 ))
1402- require .NoError (t , os .WriteFile (filepath .Join (subDir , "sub.log" ), []byte ("log" ), 0o644 ))
1403- require .NoError (t , os .WriteFile (filepath .Join (subDir , "sub.tmp" ), []byte ("temp" ), 0o644 ))
1404-
1405- tool := NewFilesystemTool ([]string {tmpDir }, WithIgnoreVCS (true ))
1406- handler := getToolHandler (t , tool , "search_files" )
1407-
1408- args := map [string ]any {
1409- "path" : tmpDir ,
1410- "pattern" : "*" ,
1411- }
1412- result := callHandler (t , handler , args )
1413-
1414- // Should respect root gitignore file
1415- // Note: go-git's ReadPatterns with nil domain reads root .gitignore only
1416- // Nested .gitignore files in subdirectories are not automatically loaded
1417- assert .Contains (t , result .Output , "root.txt" )
1418- assert .Contains (t , result .Output , "sub.txt" )
1419- assert .NotContains (t , result .Output , "root.log" ) // ignored by root .gitignore
1420- assert .NotContains (t , result .Output , "sub.log" ) // ignored by root .gitignore
1421- // sub.tmp is NOT ignored because subdir/.gitignore is not loaded by ReadPatterns(fs, nil)
1422- // This is expected behavior with the simple go-git implementation
1423- }
1424-
14251384func TestFilesystemTool_ListDirectory_IgnoresVCS (t * testing.T ) {
14261385 tmpDir := t .TempDir ()
14271386
0 commit comments