revision: forbid combining --graph and --no-walk
[gitweb.git] / http-push.c
index 6c3cc1725a9461876c7db11b9818eb553afb2fc2..0beb7ab67ffc93a6c8fe8517d711945e2c033b7d 100644 (file)
@@ -199,7 +199,7 @@ static void curl_setup_http(CURL *curl, const char *url,
        curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
 #ifndef NO_CURL_IOCTL
        curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_buffer);
-       curl_easy_setopt(curl, CURLOPT_IOCTLDATA, &buffer);
+       curl_easy_setopt(curl, CURLOPT_IOCTLDATA, buffer);
 #endif
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_fn);
        curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
@@ -1577,6 +1577,9 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
        if (buffer.len == 0)
                return;
 
+       /* Cut off trailing newline. */
+       strbuf_rtrim(&buffer);
+
        /* If it's a symref, set the refname; otherwise try for a sha1 */
        if (skip_prefix(buffer.buf, "ref: ", &name)) {
                *symref = xmemdupz(name, buffer.len - (name - buffer.buf));