Merge branch 'jc/mention-tracking-for-pull-default'
[git.git] / upload-pack.c
index dec02377936557dc4558c295d5bb9302ab3b58cf..30146a04f7a271ffaa033c0c6567ad1036f4bc49 100644 (file)
@@ -670,10 +670,17 @@ static void receive_needs(void)
        if (depth == 0 && shallows.nr == 0)
                return;
        if (depth > 0) {
-               struct commit_list *result, *backup;
+               struct commit_list *result = NULL, *backup = NULL;
                int i;
-               backup = result = get_shallow_commits(&want_obj, depth,
-                       SHALLOW, NOT_SHALLOW);
+               if (depth == INFINITE_DEPTH)
+                       for (i = 0; i < shallows.nr; i++) {
+                               struct object *object = shallows.objects[i].item;
+                               object->flags |= NOT_SHALLOW;
+                       }
+               else
+                       backup = result =
+                               get_shallow_commits(&want_obj, depth,
+                                                   SHALLOW, NOT_SHALLOW);
                while (result) {
                        struct object *object = &result->item->object;
                        if (!(object->flags & (CLIENT_SHALLOW|NOT_SHALLOW))) {