aboutsummaryrefslogtreecommitdiff
path: root/t/t1020-subdirectory.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t1020-subdirectory.sh')
-rwxr-xr-xt/t1020-subdirectory.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh
index f6a44c9ee..3b1b98599 100755
--- a/t/t1020-subdirectory.sh
+++ b/t/t1020-subdirectory.sh
@@ -17,8 +17,6 @@ test_expect_success setup '
cp one original.one &&
cp dir/two original.two
'
-LF='
-'
test_expect_success 'update-index and ls-files' '
git update-index --add one &&
@@ -140,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 &&
(