summaryrefslogtreecommitdiff
path: root/t/t4053-diff-no-index.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-07-11 12:48:44 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-07-11 12:48:44 -0700
commit36c5109e4a4d455a9aa9e0f8d20c957aa6a9bef8 (patch)
tree2d746180b910cc20d7129482ca391bbe239ff980 /t/t4053-diff-no-index.sh
parentMerge branch 'nd/clone-single-fix' into maint (diff)
parentdiff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds ch... (diff)
downloadtgif-36c5109e4a4d455a9aa9e0f8d20c957aa6a9bef8.tar.xz
Merge branch 'th/diff-no-index-fixes' into maint
"git diff --no-index" did not correctly handle relative paths and did not correctly give exit codes when run under "--quiet" option. * th/diff-no-index-fixes: diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds changes diff: handle relative paths in no-index
Diffstat (limited to 't/t4053-diff-no-index.sh')
-rwxr-xr-xt/t4053-diff-no-index.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/t4053-diff-no-index.sh b/t/t4053-diff-no-index.sh
index 4dc8c67edc..979e98398b 100755
--- a/t/t4053-diff-no-index.sh
+++ b/t/t4053-diff-no-index.sh
@@ -8,7 +8,12 @@ test_expect_success 'setup' '
mkdir a &&
mkdir b &&
echo 1 >a/1 &&
- echo 2 >a/2
+ echo 2 >a/2 &&
+ git init repo &&
+ echo 1 >repo/a &&
+ mkdir -p non/git &&
+ echo 1 >non/git/a &&
+ echo 1 >non/git/b
'
test_expect_success 'git diff --no-index directories' '
@@ -16,4 +21,12 @@ test_expect_success 'git diff --no-index directories' '
test $? = 1 && test_line_count = 14 cnt
'
+test_expect_success 'git diff --no-index relative path outside repo' '
+ (
+ cd repo &&
+ test_expect_code 0 git diff --no-index a ../non/git/a &&
+ test_expect_code 0 git diff --no-index ../non/git/a ../non/git/b
+ )
+'
+
test_done