]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/pack-objects.c
pack-objects: validation and documentation about unreachable options
[thirdparty/git.git] / builtin / pack-objects.c
index 5c674b2843ccadec710596f7b8c293bbbc6130ea..b0f3e462f377b590341ef05715e36b8e7ff788b7 100644 (file)
@@ -1379,10 +1379,10 @@ static void cleanup_preferred_base(void)
        it = pbase_tree;
        pbase_tree = NULL;
        while (it) {
-               struct pbase_tree *this = it;
-               it = this->next;
-               free(this->pcache.tree_data);
-               free(this);
+               struct pbase_tree *tmp = it;
+               it = tmp->next;
+               free(tmp->pcache.tree_data);
+               free(tmp);
        }
 
        for (i = 0; i < ARRAY_SIZE(pbase_tree_cache); i++) {
@@ -2549,6 +2549,7 @@ static void read_object_list_from_stdin(void)
        }
 }
 
+/* Remember to update object flag allocation in object.h */
 #define OBJECT_ADDED (1u<<20)
 
 static void show_commit(struct commit *commit, void *data)
@@ -3086,6 +3087,8 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
                fetch_if_missing = 0;
                argv_array_push(&rp, "--exclude-promisor-objects");
        }
+       if (unpack_unreachable || keep_unreachable || pack_loose_unreachable)
+               use_internal_rev_list = 1;
 
        if (!reuse_object)
                reuse_delta = 0;