http: respect protocol.*.allow=user for http-alternates
[gitweb.git] / fetch-pack.c
index 1a79db5b0f885df184e74b386d0a878268acd91b..b501d5c320a5117020a934a50fce2a356b0c2f0e 100644 (file)
@@ -169,7 +169,7 @@ static const unsigned char *get_rev(void)
                }
        }
 
-       return commit->object.sha1;
+       return commit->object.oid.hash;
 }
 
 enum ack_type {
@@ -487,7 +487,7 @@ static int mark_complete(const unsigned char *sha1)
                if (!t->tagged)
                        break; /* broken repository */
                o->flags |= COMPLETE;
-               o = parse_object(t->tagged->sha1);
+               o = parse_object(t->tagged->oid.hash);
        }
        if (o && o->type == OBJ_COMMIT) {
                struct commit *commit = (struct commit *)o;
@@ -511,7 +511,7 @@ static void mark_recent_complete_commits(struct fetch_pack_args *args,
        while (complete && cutoff <= complete->item->date) {
                if (args->verbose)
                        fprintf(stderr, "Marking %s as complete\n",
-                               sha1_to_hex(complete->item->object.sha1));
+                               oid_to_hex(&complete->item->object.oid));
                pop_most_recent_commit(&complete, COMPLETE);
        }
 }
@@ -671,8 +671,9 @@ static int everything_local(struct fetch_pack_args *args,
 static int sideband_demux(int in, int out, void *data)
 {
        int *xd = data;
+       int ret;
 
-       int ret = recv_sideband("fetch-pack", xd[0], out);
+       ret = recv_sideband("fetch-pack", xd[0], out);
        close(out);
        return ret;
 }
@@ -697,6 +698,7 @@ static int get_pack(struct fetch_pack_args *args,
                demux.proc = sideband_demux;
                demux.data = xd;
                demux.out = -1;
+               demux.isolate_sigpipe = 1;
                if (start_async(&demux))
                        die("fetch-pack: unable to fork off sideband"
                            " demultiplexer");