Skip to content

Commit

Permalink
t5562: do not depend on /dev/zero
Browse files Browse the repository at this point in the history
It was reported [1] that NonStop platform does not have /dev/zero.

The test uses /dev/zero as a dummy input. Passing case (http-backed
failed because of too big input size) should not be reading anything
from it. If http-backend would erroneously try to read any data
returning EOF probably would be even safer than providing some
meaningless data.

Replace /dev/zero with /dev/null to avoid issues with platforms which do
not have /dev/zero.

[1] https://public-inbox.org/git/[email protected]/

Reported-by: Randall S. Becker <[email protected]>
Signed-off-by: Max Kirillov <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
max630 authored and gitster committed Feb 19, 2019
1 parent d991948 commit 7094175
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion t/t5562-http-backend-content-length.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ test_expect_success 'CONTENT_LENGTH overflow ssite_t' '
GIT_HTTP_EXPORT_ALL=TRUE \
REQUEST_METHOD=POST \
CONTENT_LENGTH="$NOT_FIT_IN_SSIZE" \
git http-backend </dev/zero >/dev/null 2>err &&
git http-backend </dev/null >/dev/null 2>err &&
grep "fatal:.*CONTENT_LENGTH" err
'

Expand Down

0 comments on commit 7094175

Please sign in to comment.