Code

http-push: do not get confused by submodules
[git.git] / http-push.c
index b2b410df902f2a4f2bca634d82cf103d288c9042..14ef652ca76a6abab44e5f5e5b3265c3cdb34506 100644 (file)
@@ -1634,12 +1634,19 @@ static struct object_list **process_tree(struct tree *tree,
 
        init_tree_desc(&desc, tree->buffer, tree->size);
 
-       while (tree_entry(&desc, &entry)) {
-               if (S_ISDIR(entry.mode))
+       while (tree_entry(&desc, &entry))
+               switch (object_type(entry.mode)) {
+               case OBJ_TREE:
                        p = process_tree(lookup_tree(entry.sha1), p, &me, name);
-               else
+                       break;
+               case OBJ_BLOB:
                        p = process_blob(lookup_blob(entry.sha1), p, &me, name);
-       }
+                       break;
+               default:
+                       /* Subproject commit - not in this repository */
+                       break;
+               }
+
        free(tree->buffer);
        tree->buffer = NULL;
        return p;
@@ -2398,7 +2405,12 @@ int main(int argc, char **argv)
                fill_active_slots();
                add_fill_function(NULL, fill_active_slot);
 #endif
-               finish_all_active_slots();
+               do {
+                       finish_all_active_slots();
+#ifdef USE_CURL_MULTI
+                       fill_active_slots();
+#endif
+               } while (request_queue_head && !aborted);
 
                /* Update the remote branch if all went well */
                if (aborted || !update_remote(ref->new_sha1, ref_lock)) {