]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-pack-objects.c
close another possibility for propagating pack corruption
[thirdparty/git.git] / builtin-pack-objects.c
index 15b80db5a1a43ae2ae44375c2cb27978c2e70a71..15914179623d27370f02908543e9f43dbe8a31b9 100644 (file)
@@ -1698,6 +1698,16 @@ static void prepare_pack(int window, int depth)
 
        get_object_details();
 
+       /*
+        * If we're locally repacking then we need to be doubly careful
+        * from now on in order to make sure no stealth corruption gets
+        * propagated to the new pack.  Clients receiving streamed packs
+        * should validate everything they get anyway so no need to incur
+        * the additional cost here in that case.
+        */
+       if (!pack_to_stdout)
+               do_check_packed_object_crc = 1;
+
        if (!nr_objects || !window || !depth)
                return;