Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: [PATCH] fix hang in git fetch if pointed at a 0 length bundle

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:52:43

Am 03.01.2012 02:13, schrieb Brian Harring:
git-repo if interupted at the exact wrong time will generate zero
length bundles- literal empty files.  git-repo is wrong here, but
git fetch shouldn't effectively spin loop if pointed at a zero
length bundle.
Adding a test case is very much appreciated.
+test_expect_success 'die if bundle file is empty' '
How about 'empty bundle file is rejected'?
+
+   echo -n > empty-bundle
'echo -n' is not portable; use simply

	>empty-bundle &&

(note the style: no blank after >). Also chain commands using &&.
+   timeout 5 git fetch empty-bundle
Yes, there was an infinite loop. But we do not specifically protect our
git invocations in the test suite against this sort of failure. Just write

	test_must_fail git fetch empty-bundle

and end the test case here.
+   ret=$?
+   [ $ret == 128 ] && return 0
+   return $ret
+
+'
Furthermore, indentation should be one tabstop, not blanks.

-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help