From 887c6c18ba84da8d722b1528fe8cdde65d9f9860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Wed, 20 Nov 2013 08:26:41 +0700 Subject: diff: restrict pathspec limitations to diff b/f case only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit builtin_diff_b_f() needs a path, not pathspec. Other modes in diff can deal with pathspec just fine. But because of the current GUARD_PATHSPEC() location, other modes also reject :(glob) and :(icase). Move GUARD_PATHSPEC(), and the "path" assignment statement, which is the reason of this GUARD_PATHSPEC(), inside builtin_diff_b_f(). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- t/t6131-pathspec-icase.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 't/t6131-pathspec-icase.sh') diff --git a/t/t6131-pathspec-icase.sh b/t/t6131-pathspec-icase.sh index 8d4a7fcb91..a7c7ff5f49 100755 --- a/t/t6131-pathspec-icase.sh +++ b/t/t6131-pathspec-icase.sh @@ -100,4 +100,10 @@ test_expect_success 'match_pathspec_depth matches :(icase)bar with empty prefix' test_cmp expect actual ' +test_expect_success '"git diff" can take magic :(icase) pathspec' ' + echo FOO/BAR >expect && + git diff --name-only HEAD^ HEAD -- ":(icase)foo/bar" >actual && + test_cmp expect actual +' + test_done -- cgit v1.2.3