Merge branch 'ts/checkout-advice-plural'
[gitweb.git] / builtin / repack.c
index 28fbc7099a84c7406a71128f2a8d3136c145bf57..f2edeb0f4ca2b81246ee37d7ca5f53f58161ad6f 100644 (file)
@@ -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");