]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fetch-pack.c
Merge branch 'cm/rebase-i-updates'
[thirdparty/git.git] / fetch-pack.c
index 0cb59acc48661f2731f37ae123289f3e09e10102..fb04a76ca263042b145b40adf1577a81c6d7e12d 100644 (file)
@@ -846,7 +846,7 @@ static int get_pack(struct fetch_pack_args *args,
        else
                demux.out = xd[0];
 
-       if (!args->keep_pack && unpack_limit) {
+       if (!args->keep_pack && unpack_limit && !index_pack_args) {
 
                if (read_pack_header(demux.out, &header))
                        die(_("protocol error: bad pack header"));
@@ -879,7 +879,7 @@ static int get_pack(struct fetch_pack_args *args,
                        strvec_push(&cmd.args, "-v");
                if (args->use_thin_pack)
                        strvec_push(&cmd.args, "--fix-thin");
-               if (do_keep && (args->lock_pack || unpack_limit)) {
+               if ((do_keep || index_pack_args) && (args->lock_pack || unpack_limit)) {
                        char hostname[HOST_NAME_MAX + 1];
                        if (xgethostname(hostname, sizeof(hostname)))
                                xsnprintf(hostname, sizeof(hostname), "localhost");
@@ -1916,7 +1916,7 @@ static void update_shallow(struct fetch_pack_args *args,
         * remote is also shallow, check what ref is safe to update
         * without updating .git/shallow
         */
-       status = xcalloc(nr_sought, sizeof(*status));
+       CALLOC_ARRAY(status, nr_sought);
        assign_shallow_commits_to_refs(si, NULL, status);
        if (si->nr_ours || si->nr_theirs) {
                for (i = 0; i < nr_sought; i++)