Re: [PATCH v4 00/11] Resend sp/maint-dumb-http-pack-reidx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, 19 Apr 2010 07:23:04 -0700
"Shawn O. Pearce" <spearce@xxxxxxxxxxx> wrote:

> 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@xxxxxxxxx>
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@xxxxxxxxx>

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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]