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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Tay Ray Chuan
Date: Monday, April 19, 2010 - 7:46 am

Hi,

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


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

Messages in current thread:
git fetch over http:// left my repo broken, Christian Halstrick, (Thu Apr 15, 2:51 am)
Re: git fetch over http:// left my repo broken, Michael J Gruber, (Thu Apr 15, 2:58 am)
Re: git fetch over http:// left my repo broken, Ilari Liusvaara, (Thu Apr 15, 4:33 am)
Re: git fetch over http:// left my repo broken, Ilari Liusvaara, (Thu Apr 15, 4:43 am)
Re: git fetch over http:// left my repo broken, Shawn O. Pearce, (Thu Apr 15, 7:15 am)
[PATCH 0/6] detect dumb HTTP pack file corruption, Shawn O. Pearce, (Thu Apr 15, 12:09 pm)
[PATCH 1/6] http.c: Remove bad free of static block, Shawn O. Pearce, (Thu Apr 15, 12:09 pm)
[PATCH 2/6] t5550-http-fetch: Use subshell for repository ..., Shawn O. Pearce, (Thu Apr 15, 12:09 pm)
Re: [PATCH 0/6] detect dumb HTTP pack file corruption, Junio C Hamano, (Sat Apr 17, 10:56 am)
Re: [PATCH 0/6] detect dumb HTTP pack file corruption, Shawn O. Pearce, (Sat Apr 17, 12:11 pm)
Re: [PATCH v2 5/6] http-fetch: Use index-pack rather than ..., Shawn O. Pearce, (Sat Apr 17, 12:30 pm)
[PATCH v3 01/11] http.c: Remove bad free of static block, Shawn O. Pearce, (Sat Apr 17, 1:07 pm)
[PATCH v3 09/11] Allow parse_pack_index on temporary files, Shawn O. Pearce, (Sat Apr 17, 1:07 pm)
[PATCH v4 00/11] Resend sp/maint-dumb-http-pack-reidx, Shawn O. Pearce, (Mon Apr 19, 7:23 am)
[PATCH v4 09/11] Allow parse_pack_index on temporary files, Shawn O. Pearce, (Mon Apr 19, 7:23 am)
Re: [PATCH v4 00/11] Resend sp/maint-dumb-http-pack-reidx, Tay Ray Chuan, (Mon Apr 19, 7:46 am)
Re: [PATCH v4 00/11] Resend sp/maint-dumb-http-pack-reidx, Shawn O. Pearce, (Mon Apr 19, 7:49 am)
Re: [PATCH v4 00/11] Resend sp/maint-dumb-http-pack-reidx, Tay Ray Chuan, (Mon Apr 19, 9:33 pm)