diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-05-11 14:39:28 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-11 14:39:28 -0700 |
commit | c99fec6e35437f9db228c5a37c676faf844b3fa3 (patch) | |
tree | 9a6f8c27e0bd06c1029e7dd0c854ccdff9d1f92d /t/t4053-diff-no-index.sh | |
parent | Git 2.4 (diff) | |
parent | Git 2.3.8 (diff) | |
download | tgif-c99fec6e35437f9db228c5a37c676faf844b3fa3.tar.xz |
Sync with 2.3.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4053-diff-no-index.sh')
-rwxr-xr-x | t/t4053-diff-no-index.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t4053-diff-no-index.sh b/t/t4053-diff-no-index.sh index 075ece6db1..6eb83211b5 100755 --- a/t/t4053-diff-no-index.sh +++ b/t/t4053-diff-no-index.sh @@ -55,4 +55,38 @@ test_expect_success 'git diff --no-index executed outside repo gives correct err ) ' +test_expect_success 'diff D F and diff F D' ' + ( + cd repo && + echo in-repo >a && + echo non-repo >../non/git/a && + mkdir sub && + echo sub-repo >sub/a && + + test_must_fail git diff --no-index sub/a ../non/git/a >expect && + test_must_fail git diff --no-index sub/a ../non/git/ >actual && + test_cmp expect actual && + + test_must_fail git diff --no-index a ../non/git/a >expect && + test_must_fail git diff --no-index a ../non/git/ >actual && + test_cmp expect actual && + + test_must_fail git diff --no-index ../non/git/a a >expect && + test_must_fail git diff --no-index ../non/git a >actual && + test_cmp expect actual + ) +' + +test_expect_success 'turning a file into a directory' ' + ( + cd non/git && + mkdir d e e/sub && + echo 1 >d/sub && + echo 2 >e/sub/file && + printf "D\td/sub\nA\te/sub/file\n" >expect && + test_must_fail git diff --no-index --name-status d e >actual && + test_cmp expect actual + ) +' + test_done |