commit: convert register_commit_graft to handle arbitrary repositories
[gitweb.git] / upload-pack.c
index 4a82602be5d0ab111a805a2f2456f382ae7a7364..51b9038111e7f7b2f54443fa613c1cd0b2bfb457 100644 (file)
@@ -3,6 +3,7 @@
 #include "refs.h"
 #include "pkt-line.h"
 #include "sideband.h"
+#include "object-store.h"
 #include "tag.h"
 #include "object.h"
 #include "commit.h"
@@ -662,7 +663,7 @@ static void send_shallow(struct commit_list *result)
                if (!(object->flags & (CLIENT_SHALLOW|NOT_SHALLOW))) {
                        packet_write_fmt(1, "shallow %s",
                                         oid_to_hex(&object->oid));
-                       register_shallow(&object->oid);
+                       register_shallow(the_repository, &object->oid);
                        shallow_nr++;
                }
                result = result->next;
@@ -699,14 +700,14 @@ static void send_unshallow(const struct object_array *shallows)
                        add_object_array(object, NULL, &extra_edge_obj);
                }
                /* make sure commit traversal conforms to client */
-               register_shallow(&object->oid);
+               register_shallow(the_repository, &object->oid);
        }
 }
 
 static void deepen(int depth, int deepen_relative,
                   struct object_array *shallows)
 {
-       if (depth == INFINITE_DEPTH && !is_repository_shallow()) {
+       if (depth == INFINITE_DEPTH && !is_repository_shallow(the_repository)) {
                int i;
 
                for (i = 0; i < shallows->nr; i++) {
@@ -911,7 +912,8 @@ static void receive_needs(void)
                if (shallows.nr > 0) {
                        int i;
                        for (i = 0; i < shallows.nr; i++)
-                               register_shallow(&shallows.objects[i].item->oid);
+                               register_shallow(the_repository,
+                                                &shallows.objects[i].item->oid);
                }
 
        shallow_nr += shallows.nr;