git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Tay Ray Chuan <rctay89@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Mike Hommey <mh@glandium.org>
Subject: Re: [PATCH 19/23] http-push.c::fetch_symref(): use the new http API
Date: Fri, 05 Jun 2009 13:54:07 -0700 (PDT)	[thread overview]
Message-ID: <m37hzq5rod.fsf@localhost.localdomain> (raw)
In-Reply-To: <20090606000559.483f22da.rctay89@gmail.com>

Tay Ray Chuan <rctay89@gmail.com> writes:

> From:	Mike Hommey <mh@glandium.org>
> Subject: [WIP Patch 09/12] Use the new http API in fetch_symref()

What is the subject of this patch:
  "http-push.c::fetch_symref(): use the new http API"
or
  "Use the new http API in fetch_symref()"

> Date:	Sun, 18 Jan 2009 09:04:34 +0100
> 
> Signed-off-by: Mike Hommey <mh@glandium.org>
> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
> ---

If you wanted to note old subject, it would be better to put it in
comments (here).

>  http-push.c |   20 +++-----------------
>  1 files changed, 3 insertions(+), 17 deletions(-)
> 
> diff --git a/http-push.c b/http-push.c
> index 455e0aa..1714e4e 100644
> --- a/http-push.c
> +++ b/http-push.c
> @@ -2029,27 +2029,13 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)
>  {
>  	char *url;
>  	struct strbuf buffer = STRBUF_INIT;
> -	struct active_request_slot *slot;
> -	struct slot_results results;
> 
>  	url = xmalloc(strlen(repo->url) + strlen(path) + 1);
>  	sprintf(url, "%s%s", repo->url, path);
> 
> -	slot = get_active_slot();
> -	slot->results = &results;
> -	curl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);
> -	curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
> -	curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, NULL);
> -	curl_easy_setopt(slot->curl, CURLOPT_URL, url);
> -	if (start_active_slot(slot)) {
> -		run_active_slot(slot);
> -		if (results.curl_result != CURLE_OK) {
> -			die("Couldn't get %s for remote symref\n%s",
> -			    url, curl_errorstr);
> -		}
> -	} else {
> -		die("Unable to start remote symref request");
> -	}
> +	if (http_get_strbuf(url, &buffer, 0) != HTTP_OK)
> +		die("Couldn't get %s for remote symref\n%s", url,
> +		    curl_errorstr);
>  	free(url);
> 
>  	free(*symref);
> --
> 1.6.3.1
> 

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  reply	other threads:[~2009-06-05 20:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 16:05 [PATCH 19/23] http-push.c::fetch_symref(): use the new http API Tay Ray Chuan
2009-06-05 20:54 ` Jakub Narebski [this message]
2009-06-06  1:02   ` Tay Ray Chuan
2009-06-06  5:32     ` Junio C Hamano
2009-06-06  7:20       ` Tay Ray Chuan
     [not found] <cover.1244277116.git.rctay89@gmail.com>
2009-06-06  8:43 ` Tay Ray Chuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m37hzq5rod.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mh@glandium.org \
    --cc=rctay89@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).