Skip to content

Commit 0df49be

Browse files
jrngitster
authored andcommitted
diff test: reading a directory as a file need not error out
There is no guarantee that strbuf_read_file must error out for directories. On some operating systems (e.g., Debian GNU/kFreeBSD wheezy), reading a directory gives its raw content: $ head -c5 < / | cat -A ^AM-|^_^@^L$ As a result, 'git diff -O/' succeeds instead of erroring out on these systems, causing t4056.5 "orderfile is a directory" to fail. On some weird OS it might even make sense to pass a directory to the -O option and this is not a common user mistake that needs catching. Remove the test. Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6d8940b commit 0df49be

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

t/t4056-diff-order.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ test_expect_success POSIXPERM,SANITY 'unreadable orderfile' '
6868
test_must_fail git diff -Ounreadable_file --name-only HEAD^..HEAD
6969
'
7070

71-
test_expect_success 'orderfile is a directory' '
72-
test_must_fail git diff -O/ --name-only HEAD^..HEAD
73-
'
74-
7571
for i in 1 2
7672
do
7773
test_expect_success "orderfile using option ($i)" '

0 commit comments

Comments
 (0)