Merge branch 'kb/status-ignored-optim-2' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 10 Jun 2013 00:05:15 +0000 (17:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Jun 2013 00:05:15 +0000 (17:05 -0700)
Fix recent regression of .gitignore files that list !directory to
mark it not-ignored.

* kb/status-ignored-optim-2:
dir.c: fix ignore processing within not-ignored directories

1  2 
t/t3001-ls-files-others-exclude.sh
index 4e3735f0cb28d2b545f59a2464ea74bea4b626a1,b3814cdb42f380f234f3fb423cabc5c634f1c854..f0421c09c700bc1203d2ef563c54157e94c83b33
@@@ -103,7 -103,7 +103,7 @@@ test_expect_success 
       test_cmp expect output'
  
  test_expect_success 'restore gitignore' '
 -      git checkout $allignores &&
 +      git checkout --ignore-skip-worktree-bits $allignores &&
        rm .git/index
  '
  
@@@ -175,6 -175,24 +175,24 @@@ test_expect_success 'negated exclude ma
        grep "^a.1" output
  '
  
+ test_expect_success 'excluded directory overrides content patterns' '
+       git ls-files --others --exclude="one" --exclude="!one/a.1" >output &&
+       if grep "^one/a.1" output
+       then
+               false
+       fi
+ '
+ test_expect_success 'negated directory doesn'\''t affect content patterns' '
+       git ls-files --others --exclude="!one" --exclude="one/a.1" >output &&
+       if grep "^one/a.1" output
+       then
+               false
+       fi
+ '
  test_expect_success 'subdirectory ignore (setup)' '
        mkdir -p top/l1/l2 &&
        (