Re: [PATCH v4 00/11] Resend sp/maint-dumb-http-pack-reidx
- From
Tay Ray Chuan <rctay89@gmail.com>
- Date
- Apr 19, 2010, 14:46 UTC
- Message-ID
- <20100419224643.00001ff1@unknown>
- In-Reply-To
- <1271686990-16363-1-git-send-email-spearce@spearce.org>
Hi,
On Mon, 19 Apr 2010 07:23:04 -0700 "Shawn O. Pearce" <spearce@spearce.org> wrote:
Show 6 quoted lines
> This is a resend of the last half of the series, from patch 6/11
> to the end, to address some minor review comments.
>
> Junio, I think you need to reset my branch to 0da8b2e7c80a6d
> ("http.c: Don't store destination name in structures"), and
> then apply this group.the small patch below could also be applied to the rebased topic branch.
-->8-- From: Tay Ray Chuan <rctay89@gmail.com> Subject: [PATCH] http.c::new_http_pack_request: do away with the temp variable filename
Now that the temporary variable char *filename is only used in one place, do away with it and just call sha1_pack_name() directly.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
diff --git a/http.c b/http.c index c75eb95..110cff9 100644 --- a/http.c +++ b/http.c @@ -1027,7 +1027,6 @@ int finish_http_pack_request(struct http_pack_request *preq) struct http_pack_request *new_http_pack_request( struct packed_git *target, const char *base_url) { - char *filename; long prev_posn = 0; char range[RANGE_HEADER_SIZE]; struct strbuf buf = STRBUF_INIT; @@ -1042,8 +1041,8 @@ struct http_pack_request *new_http_pack_request( sha1_to_hex(target->sha1)); preq->url = strbuf_detach(&buf, NULL); - filename = sha1_pack_name(target->sha1); - snprintf(preq->tmpfile, sizeof(preq->tmpfile), "%s.temp", filename); + snprintf(preq->tmpfile, sizeof(preq->tmpfile), "%s.temp", + sha1_pack_name(target->sha1)); preq->packfile = fopen(preq->tmpfile, "a"); if (!preq->packfile) { error("Unable to open local file %s for pack", --
-- Cheers, Ray Chuan