Merge branch 'jc/maint-grep-untracked-exclude' into jc/grep-untracked-exclude
[gitweb.git] / t / t1020-subdirectory.sh
index 7e7996122850500de57e2740731b15a0703b03a4..3b1b985996e9a6b52b032ef45c5be9b1c57b60f6 100755 (executable)
@@ -138,6 +138,22 @@ test_expect_success 'GIT_PREFIX for !alias' '
        test_cmp expect actual
 '
 
+test_expect_success 'GIT_PREFIX for built-ins' '
+       # Use GIT_EXTERNAL_DIFF to test that the "diff" built-in
+       # receives the GIT_PREFIX variable.
+       printf "dir/" >expect &&
+       printf "#!/bin/sh\n" >diff &&
+       printf "printf \"\$GIT_PREFIX\"" >>diff &&
+       chmod +x diff &&
+       (
+               cd dir &&
+               printf "change" >two &&
+               env GIT_EXTERNAL_DIFF=./diff git diff >../actual
+               git checkout -- two
+       ) &&
+       test_cmp expect actual
+'
+
 test_expect_success 'no file/rev ambiguity check inside .git' '
        git commit -a -m 1 &&
        (