Skip to content

Commit

Permalink
diff test: reading a directory as a file need not error out
Browse files Browse the repository at this point in the history
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 <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Jan 10, 2014
1 parent 6d8940b commit 0df49be
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions t/t4056-diff-order.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ test_expect_success POSIXPERM,SANITY 'unreadable orderfile' '
test_must_fail git diff -Ounreadable_file --name-only HEAD^..HEAD
'

test_expect_success 'orderfile is a directory' '
test_must_fail git diff -O/ --name-only HEAD^..HEAD
'

for i in 1 2
do
test_expect_success "orderfile using option ($i)" '
Expand Down

0 comments on commit 0df49be

Please sign in to comment.