diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-03-25 12:54:26 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-03-25 12:54:26 -0700 |
commit | 05e816e37f4eb023a3606b2942192390566c6107 (patch) | |
tree | 2f266768dd254fcc510f6a3966bb895e6ca6e798 /builtin/repack.c | |
parent | a801bb8c297737d99a0b20d61a3a956f0c92a3b9 (diff) | |
parent | ea56c4e02fc1d5ce6a6b5083c284e32ffc6367e6 (diff) | |
download | git-05e816e37f4eb023a3606b2942192390566c6107.tar.gz |
Merge branch 'jk/prune-with-corrupt-refs'
"git prune" used to largely ignore broken refs when deciding which
objects are still being used, which could spread an existing small
damage and make it a larger one.
* jk/prune-with-corrupt-refs:
refs.c: drop curate_packed_refs
repack: turn on "ref paranoia" when doing a destructive repack
prune: turn on ref_paranoia flag
refs: introduce a "ref paranoia" flag
t5312: test object deletion code paths in a corrupted repository
Diffstat (limited to 'builtin/repack.c')
-rw-r--r-- | builtin/repack.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/repack.c b/builtin/repack.c index 28fbc7099a..f2edeb0f4c 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -228,13 +228,17 @@ int cmd_repack(int argc, const char **argv, const char *prefix) get_non_kept_pack_filenames(&existing_packs); if (existing_packs.nr && delete_redundant) { - if (unpack_unreachable) + if (unpack_unreachable) { argv_array_pushf(&cmd.args, "--unpack-unreachable=%s", unpack_unreachable); - else if (pack_everything & LOOSEN_UNREACHABLE) + argv_array_push(&cmd.env_array, "GIT_REF_PARANOIA=1"); + } else if (pack_everything & LOOSEN_UNREACHABLE) { argv_array_push(&cmd.args, "--unpack-unreachable"); + } else { + argv_array_push(&cmd.env_array, "GIT_REF_PARANOIA=1"); + } } } else { argv_array_push(&cmd.args, "--unpacked"); |