commit: convert parts to struct object_id
[gitweb.git] / send-pack.c
index 949cb61aa0d681e30b7e8199ef9e31ff0caee089..fa7701b8ff9f95c3101480a677a91d0aedfbd76e 100644 (file)
@@ -47,6 +47,7 @@ static int pack_objects(int fd, struct ref *refs, struct sha1_array *extra, stru
                NULL,
                NULL,
                NULL,
+               NULL,
        };
        struct child_process po = CHILD_PROCESS_INIT;
        int i;
@@ -60,6 +61,8 @@ static int pack_objects(int fd, struct ref *refs, struct sha1_array *extra, stru
                argv[i++] = "-q";
        if (args->progress)
                argv[i++] = "--progress";
+       if (is_repository_shallow())
+               argv[i++] = "--shallow";
        po.argv = argv;
        po.in = -1;
        po.out = args->stateless_rpc ? -1 : fd;
@@ -179,7 +182,7 @@ static int advertise_shallow_grafts_cb(const struct commit_graft *graft, void *c
 {
        struct strbuf *sb = cb;
        if (graft->nr_parent == -1)
-               packet_buf_write(sb, "shallow %s\n", sha1_to_hex(graft->sha1));
+               packet_buf_write(sb, "shallow %s\n", oid_to_hex(&graft->oid));
        return 0;
 }