]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fetch-pack.c
quote: rename misnamed sq_lookup[] to cq_lookup[]
[thirdparty/git.git] / fetch-pack.c
index 6c576a98e910e0e643652bebe6993f4a793a4440..b10c4323155b77f2ef271564cef862147a880596 100644 (file)
@@ -793,6 +793,10 @@ static void write_promisor_file(const char *keep_name,
        strbuf_release(&promisor_name);
 }
 
+/*
+ * Pass 1 as "only_packfile" if the pack received is the only pack in this
+ * fetch request (that is, if there were no packfile URIs provided).
+ */
 static int get_pack(struct fetch_pack_args *args,
                    int xd[2], struct string_list *pack_lockfiles,
                    int only_packfile,
@@ -865,13 +869,16 @@ static int get_pack(struct fetch_pack_args *args,
                         * have this responsibility.
                         */
                        args->check_self_contained_and_connected = 0;
-               /*
-                * If we're obtaining the filename of a lockfile, we'll use
-                * that filename to write a .promisor file with more
-                * information below. If not, we need index-pack to do it for
-                * us.
-                */
-               if (!(do_keep && pack_lockfiles) && args->from_promisor)
+
+               if (args->from_promisor)
+                       /*
+                        * write_promisor_file() may be called afterwards but
+                        * we still need index-pack to know that this is a
+                        * promisor pack. For example, if transfer.fsckobjects
+                        * is true, index-pack needs to know that .gitmodules
+                        * is a promisor object (so that it won't complain if
+                        * it is missing).
+                        */
                        strvec_push(&cmd.args, "--promisor");
        }
        else {
@@ -891,7 +898,7 @@ static int get_pack(struct fetch_pack_args *args,
            : transfer_fsck_objects >= 0
            ? transfer_fsck_objects
            : 0) {
-               if (args->from_promisor)
+               if (args->from_promisor || !only_packfile)
                        /*
                         * We cannot use --strict in index-pack because it
                         * checks both broken objects and links, but we only