From: Junio C Hamano Date: Thu, 21 Feb 2008 00:13:32 +0000 (-0800) Subject: Merge branch 'js/maint-http-push' X-Git-Tag: v1.5.5-rc0~179 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/378b2607f07bd2fa0eaa8648e7dc8db636708d74?hp=-c Merge branch 'js/maint-http-push' * js/maint-http-push: http-push: avoid a needless goto http-push: do not get confused by submodules http-push: avoid invalid memory accesses --- 378b2607f07bd2fa0eaa8648e7dc8db636708d74 diff --combined http-push.c index 63ff218b3c,f9b77d6021..0beb7406c3 --- a/http-push.c +++ b/http-push.c @@@ -1634,12 -1634,19 +1634,19 @@@ static struct object_list **process_tre 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; @@@ -2383,8 -2390,7 +2390,8 @@@ int main(int argc, char **argv /* Generate a list of objects that need to be pushed */ pushing = 0; - prepare_revision_walk(&revs); + if (prepare_revision_walk(&revs)) + die("revision walk setup failed"); mark_edges_uninteresting(revs.commits); objects_to_send = get_delta(&revs, ref_lock); finish_all_active_slots(); @@@ -2399,15 -2405,17 +2406,17 @@@ 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)) { + if (aborted || !update_remote(ref->new_sha1, ref_lock)) rc = 1; - goto unlock; - } - unlock: if (!rc) fprintf(stderr, " done\n"); unlock_remote(ref_lock);