diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-07-05 06:40:38 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-05 06:40:38 (GMT) |
commit | 60ad08bfdfe393fd86391e2f9e60e8ffccc78e5b (patch) | |
tree | e856039e5ad6149a72dfa5d9160ff1b1888dd23e /t/t4053-diff-no-index.sh | |
parent | 348c44e78eb079fa97a575f8fb8c1fcac747efe5 (diff) | |
parent | 304970dd5d9e542e70eca98932c1e9f26770678e (diff) | |
download | git-60ad08bfdfe393fd86391e2f9e60e8ffccc78e5b.zip git-60ad08bfdfe393fd86391e2f9e60e8ffccc78e5b.tar.gz git-60ad08bfdfe393fd86391e2f9e60e8ffccc78e5b.tar.bz2 |
Merge branch 'th/diff-no-index-fixes'
"git diff --no-index" did not correctly handle relative paths and
did not give correct 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-x | t/t4053-diff-no-index.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/t/t4053-diff-no-index.sh b/t/t4053-diff-no-index.sh index 4dc8c67..979e983 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 |