Code

t7810: overlapping pathspecs and depth limit
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Wed, 15 Dec 2010 15:02:56 +0000 (22:02 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Dec 2010 22:45:25 +0000 (14:45 -0800)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7810-grep.sh

index 023f225a4b1f22c66fb291a76690564696d56035..d89faeebb3d9da55e94d7b4a65ca168ea44aabc3 100755 (executable)
@@ -182,6 +182,24 @@ do
                test_cmp expected actual
        '
 
+       test_expect_success "grep --max-depth 0 -- . t $L" '
+               {
+                       echo ${HC}t/v:1:vvv
+                       echo ${HC}v:1:vvv
+               } >expected &&
+               git grep --max-depth 0 -n -e vvv $H -- . t >actual &&
+               test_cmp expected actual
+       '
+
+       test_expect_success "grep --max-depth 0 -- t . $L" '
+               {
+                       echo ${HC}t/v:1:vvv
+                       echo ${HC}v:1:vvv
+               } >expected &&
+               git grep --max-depth 0 -n -e vvv $H -- t . >actual &&
+               test_cmp expected actual
+       '
+
 done
 
 cat >expected <<EOF