lock_flags = 0;
}
XML_ParserFree(parser);
+ if (!lock_flags)
+ error("Error: no DAV locking support on %s",
+ remote->url);
+
+ } else {
+ error("Cannot access URL %s, return code %d",
+ remote->url, results.curl_result);
+ lock_flags = 0;
}
} else {
- fprintf(stderr, "Unable to start PROPFIND request\n");
+ error("Unable to start PROPFIND request on %s", remote->url);
}
strbuf_release(&out_buffer.buf);
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;
int i;
int new_refs;
struct ref *ref;
+ char *rewritten_url = NULL;
setup_git_directory();
no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:");
+ if (remote->url && remote->url[strlen(remote->url)-1] != '/') {
+ rewritten_url = malloc(strlen(remote->url)+2);
+ strcpy(rewritten_url, remote->url);
+ strcat(rewritten_url, "/");
+ remote->url = rewritten_url;
+ ++remote->path_len;
+ }
+
/* Verify DAV compliance/lock support */
if (!locking_available()) {
- fprintf(stderr, "Error: no DAV locking support on remote repo %s\n", remote->url);
rc = 1;
goto cleanup;
}
/* 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();
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);
}
cleanup:
+ if (rewritten_url)
+ free(rewritten_url);
if (info_ref_lock)
unlock_remote(info_ref_lock);
free(remote);