From: Junio C Hamano Date: Tue, 18 Mar 2014 20:58:58 +0000 (-0700) Subject: Merge branch 'nd/submodule-pathspec-ending-with-slash' into maint X-Git-Tag: v1.9.1~13 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6a0556e4c0d0174d4c1760469e0f4d348b5ca844 Merge branch 'nd/submodule-pathspec-ending-with-slash' into maint 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() --- 6a0556e4c0d0174d4c1760469e0f4d348b5ca844 diff --cc t/t4010-diff-pathspec.sh index 9f5659f7fe,d30ff34be7..2bb973655b --- a/t/t4010-diff-pathspec.sh +++ b/t/t4010-diff-pathspec.sh @@@ -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