t1450: clean up sub-objects in duplicate-entry test
commit1ada11ee62658ff4366d93b97995eea055827171
authorJeff King <peff@peff.net>
Mon, 16 Jan 2017 21:24:03 +0000 (16 16:24 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Jan 2017 20:49:41 +0000 (17 12:49 -0800)
tree98948f90721e734572c3224c24f849315670fc68
parenta274e0a036ea886a31f8b216564ab1b4a3142f6c
t1450: clean up sub-objects in duplicate-entry test

This test creates a multi-level set of trees, but its
cleanup routine only removes the top-level tree. After the
test finishes, the inner tree and the blob it points to
remain, making the inner tree dangling.

A later test ("cleaned up") verifies that we've removed any
cruft and "git fsck" output is clean. This passes only
because of a bug in git-fsck which fails to notice dangling
trees.

In preparation for fixing the bug, let's teach this earlier
test to clean up after itself correctly. We have to remove
the inner tree (and therefore the blob, too, which becomes
dangling after removing that tree).

Since the setup code happens inside a subshell, we can't
just set a variable for each object. However, we can stuff
all of the sha1s into the $T output variable, which is not
used for anything except cleanup.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1450-fsck.sh