shallow.c: the 8 steps to select new commits for .git/shallow
[gitweb.git] / fetch-pack.c
index a0e0350ae6bdf338b3c11c21fc050edb60c88569..0e7483e1fe2b025a84681d89a850ea1f584dc699 100644 (file)
@@ -311,7 +311,7 @@ static int find_common(struct fetch_pack_args *args,
        }
 
        if (is_repository_shallow())
-               write_shallow_commits(&req_buf, 1);
+               write_shallow_commits(&req_buf, 1, NULL);
        if (args->depth > 0)
                packet_buf_write(&req_buf, "deepen %d", args->depth);
        packet_buf_flush(&req_buf);
@@ -747,6 +747,10 @@ static int get_pack(struct fetch_pack_args *args,
                close(cmd.out);
        }
 
+       if (!use_sideband)
+               /* Closed by start_command() */
+               xd[0] = -1;
+
        ret = finish_command(&cmd);
        if (!ret || (args->check_self_contained_and_connected && ret == 1))
                args->self_contained_and_connected =
@@ -846,7 +850,8 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
        if (args->stateless_rpc)
                packet_flush(fd[1]);
        if (args->depth > 0)
-               setup_alternate_shallow(&shallow_lock, &alternate_shallow_file);
+               setup_alternate_shallow(&shallow_lock, &alternate_shallow_file,
+                                       NULL);
        else
                alternate_shallow_file = NULL;
        if (get_pack(args, fd, pack_lockfile))