summaryrefslogtreecommitdiff
path: root/builtin/prune.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-03-20 18:43:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-03-20 19:40:56 (GMT)
commitff4056bbc35aa499f449cbab46702a76cea0e532 (patch)
tree685f583e04d455bf77135c38e61a892c48223e6d /builtin/prune.c
parent49672f26d9a3826a6a74c6ff4d2409b7b0c74495 (diff)
downloadgit-ff4056bbc35aa499f449cbab46702a76cea0e532.zip
git-ff4056bbc35aa499f449cbab46702a76cea0e532.tar.gz
git-ff4056bbc35aa499f449cbab46702a76cea0e532.tar.bz2
prune: turn on ref_paranoia flag
Prune should know about broken objects at the tips of refs, so that we can feed them to our traversal rather than ignoring them. It's better for us to abort the operation on the broken object than it is to start deleting objects with an incomplete view of the reachability namespace. Note that for missing objects, aborting is the best we can do. For a badly-named ref, we technically could use its sha1 as a reachability tip. However, the iteration code just feeds us a null sha1, so there would be a reasonable amount of code involved to pass down our wishes. It's not really worth trying to do better, because this is a case that should happen extremely rarely, and the message we provide: fatal: unable to parse object: refs/heads/bogus:name is probably enough to point the user in the right direction. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/prune.c')
-rw-r--r--builtin/prune.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/prune.c b/builtin/prune.c
index 04d3b12..17094ad 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -115,6 +115,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
expire = ULONG_MAX;
save_commit_buffer = 0;
check_replace_refs = 0;
+ ref_paranoia = 1;
init_revisions(&revs, prefix);
argc = parse_options(argc, argv, prefix, options, prune_usage, 0);