pack-objects: double-check options before discarding objects
[gitweb.git] / builtin / pack-objects.c
index 0cf95c9901aa1ce342bc209e437477eb3f8e938a..64123d4222187afcf3bede5def93157bdff2748d 100644 (file)
@@ -2757,6 +2757,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 
        if (keep_unreachable && unpack_unreachable)
                die("--keep-unreachable and --unpack-unreachable are incompatible.");
+       if (!rev_list_all || !rev_list_reflog || !rev_list_index)
+               unpack_unreachable_expiration = 0;
 
        if (!use_internal_rev_list || !pack_to_stdout || is_repository_shallow())
                use_bitmap_index = 0;