repack: turn on "ref paranoia" when doing a destructive repack
commit8d422993617be42a48a54fd7325d5ba5350c1082
authorJeff King <peff@peff.net>
Fri, 20 Mar 2015 18:43:13 +0000 (20 14:43 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Mar 2015 19:41:38 +0000 (20 12:41 -0700)
treed45cdb4f36b544a6b76a04a45a6694b27e8fa292
parentff4056bbc35aa499f449cbab46702a76cea0e532
repack: turn on "ref paranoia" when doing a destructive repack

If we are repacking with "-ad", we will drop any unreachable
objects. Likewise, using "-Ad --unpack-unreachable=<time>"
will drop any old, unreachable objects. In these cases, we
want to make sure the reachability we compute with "--all"
is complete. We can do this by passing GIT_REF_PARANOIA=1 in
the environment to pack-objects.

Note that "-Ad" is safe already, because it only loosens
unreachable objects. It is up to "git prune" to avoid
deleting them.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/repack.c
t/t5312-prune-corruption.sh