diff --git a/remote-curl.c b/remote-curl.c
index b8cf45a7dd439b83c80bcf7a397e1b8e34c70f67..0e720ee8bbf4cbc6a50336a1f1c93bfc63842fe3 100644 (file)
--- a/remote-curl.c
+++ b/remote-curl.c
http_ret = http_get_strbuf(refs_url, &buffer, HTTP_NO_CACHE);
/* try again with "plain" url (no ? or & appended) */
http_ret = http_get_strbuf(refs_url, &buffer, HTTP_NO_CACHE);
/* try again with "plain" url (no ? or & appended) */
- if (http_ret != HTTP_OK) {
+ if (http_ret != HTTP_OK && http_ret != HTTP_NOAUTH) {
free(refs_url);
strbuf_reset(&buffer);
free(refs_url);
strbuf_reset(&buffer);
close(client.in);
client.in = -1;
close(client.in);
client.in = -1;
- strbuf_read(&rpc->result, client.out, 0);
+ if (!err) {
+ strbuf_read(&rpc->result, client.out, 0);
+ } else {
+ char buf[4096];
+ for (;;)
+ if (xread(client.out, buf, sizeof(buf)) <= 0)
+ break;
+ }
close(client.out);
client.out = -1;
close(client.out);
client.out = -1;
url = strbuf_detach(&buf, NULL);
url = strbuf_detach(&buf, NULL);
- http_init(remote);
+ http_init(remote, url);
do {
if (strbuf_getline(&buf, stdin, '\n') == EOF) {
do {
if (strbuf_getline(&buf, stdin, '\n') == EOF) {