fast-import: add a get-mark command
[gitweb.git] / http-push.c
index 6c3cc1725a9461876c7db11b9818eb553afb2fc2..c98dad23dfd86875209295fadda39c1f1b4f5224 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);
@@ -316,7 +316,6 @@ static void start_fetch_packed(struct transfer_request *request)
 
        preq = new_http_pack_request(target, repo->url);
        if (preq == NULL) {
-               release_http_pack_request(preq);
                repo->can_update_info_refs = 0;
                return;
        }
@@ -365,7 +364,6 @@ static void start_put(struct transfer_request *request)
        hdrlen = sprintf(hdr, "%s %lu", typename(type), len) + 1;
 
        /* Set it up */
-       memset(&stream, 0, sizeof(stream));
        git_deflate_init(&stream, zlib_compression_level);
        size = git_deflate_bound(&stream, len + hdrlen);
        strbuf_init(&request->buffer.buf, size);
@@ -1577,6 +1575,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));