From: Junio C Hamano Date: Tue, 17 Feb 2015 18:15:27 +0000 (-0800) Subject: Merge branch 'jk/remote-curl-an-array-in-struct-cannot-be-null' X-Git-Tag: v2.4.0-rc0~118 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f6b50a8bf4dcc0e0e67698d365640904ac8522b3 Merge branch 'jk/remote-curl-an-array-in-struct-cannot-be-null' Fix a misspelled conditional that is always true. * jk/remote-curl-an-array-in-struct-cannot-be-null: do not check truth value of flex arrays --- f6b50a8bf4dcc0e0e67698d365640904ac8522b3 diff --cc remote-curl.c index dd63bc27ab,38cab05ec5..515ac9b411 --- a/remote-curl.c +++ b/remote-curl.c @@@ -755,17 -511,14 +755,17 @@@ static int fetch_git(struct discovery * depth_arg = strbuf_detach(&buf, NULL); argv[argc++] = depth_arg; } - argv[argc++] = url; + argv[argc++] = url.buf; + argv[argc++] = NULL; + for (i = 0; i < nr_heads; i++) { struct ref *ref = to_fetch[i]; - if (!ref->name || !*ref->name) + if (!*ref->name) die("cannot fetch by sha1 over smart http"); - argv[argc++] = ref->name; + packet_buf_write(&preamble, "%s %s\n", + sha1_to_hex(ref->old_sha1), ref->name); } - argv[argc++] = NULL; + packet_buf_flush(&preamble); memset(&rpc, 0, sizeof(rpc)); rpc.service_name = "git-upload-pack",