t1450 (fsck): remove dangling objects
commitdbedf8bf42f63847b096aeb7d6b96cf3a2233b7a
authorJonathan Nieder <jrnieder@gmail.com>
Tue, 7 Sep 2010 01:47:07 +0000 (6 20:47 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Sep 2010 22:58:32 +0000 (9 15:58 -0700)
tree2e707207416f96b6134eb1f9701dffe4db0390bb
parent18a826924284339e2b637ab747f196235bee1939
t1450 (fsck): remove dangling objects

The fsck test is generally careful to remove the corrupt objects
it inserts, but dangling objects are left behind due to some typos
and omissions.  It is better to clean up more completely, to
simplify the addition of later tests.  So:

 - guard setup and cleanup with test_expect_success to catch
   typos and errors;
 - check both stdout and stderr when checking for empty fsck
   output;
 - use test_cmp empty file in place of test $(wc -l <file) = 0,
   for better debugging output when running tests with -v;
 - add a remove_object () helper and use it to replace broken
   object removal code that forgot about the fanout in
   .git/objects;
 - disable gc.auto, to avoid tripping up object removal if the
   number of objects ever reaches that threshold.
 - use test_when_finished to ensure cleanup tasks are run and
   succeed when tests fail;
 - add a new final test that no breakage or dangling objects
   was left behind.

While at it, add a brief description to test_description of the
history that is expected to persist between tests.

Part of a campaign to clean up subshell usage in tests.

Cc: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1450-fsck.sh