Merge branch 'nd/submodule-pathspec-ending-with-slash' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 18 Mar 2014 20:58:58 +0000 (13:58 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Mar 2014 20:58:58 +0000 (13:58 -0700)
Allow "git cmd path/", when the 'path' is where a submodule is
bound to the top-level working tree, to match 'path', despite the
extra and unnecessary trailing slash (such a slash is often
given by command line completion).

* nd/submodule-pathspec-ending-with-slash:
clean: use cache_name_is_other()
clean: replace match_pathspec() with dir_path_match()
pathspec: pass directory indicator to match_pathspec_item()
match_pathspec: match pathspec "foo/" against directory "foo"
dir.c: prepare match_pathspec_item for taking more flags
pathspec: rename match_pathspec_depth() to match_pathspec()
pathspec: convert some match_pathspec_depth() to dir_path_match()
pathspec: convert some match_pathspec_depth() to ce_path_match()

1  2 
t/t4010-diff-pathspec.sh
index 9f5659f7fe4df23d805e6c38264a1ebf38fc2538,d30ff34be7ebaf01ef22ce63cc2d1beeccf6a057..2bb973655bf043cc43292764ffd68becda25aa2e
@@@ -127,17 -127,10 +127,23 @@@ test_expect_success 'diff-tree ignores 
        test_cmp expect actual
  '
  
 +test_expect_success 'diff multiple wildcard pathspecs' '
 +      mkdir path2 &&
 +      echo rezrov >path2/file1 &&
 +      git update-index --add path2/file1 &&
 +      tree3=`git write-tree` &&
 +      git diff --name-only $tree $tree3 -- "path2*1" "path1*1" >actual &&
 +      cat <<-\EOF >expect &&
 +      path1/file1
 +      path2/file1
 +      EOF
 +      test_cmp expect actual
 +'
 +
+ test_expect_success 'diff-cache ignores trailing slash on submodule path' '
+       git diff --name-only HEAD^ submod >expect &&
+       git diff --name-only HEAD^ submod/ >actual &&
+       test_cmp expect actual
+ '
  test_done