aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorTay Ray Chuan <rctay89@gmail.com>2010-04-19 22:46:43 +0800
committerJunio C Hamano <gitster@pobox.com>2010-04-19 17:57:50 -0700
commit90d05713575ea6ed21d05228bcda8461f7b28ccf (patch)
treee23264b7f72017f712c07c33cf30902f98e5ac8e /http.c
parent750ef42516bb343a7755f003720e43cd8dd64c3e (diff)
downloadgit-90d05713575ea6ed21d05228bcda8461f7b28ccf.tar.gz
git-90d05713575ea6ed21d05228bcda8461f7b28ccf.tar.xz
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> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.c')
-rw-r--r--http.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/http.c b/http.c
index 0813c9ecd..e41fcc380 100644
--- a/http.c
+++ b/http.c
@@ -1077,7 +1077,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;
@@ -1092,8 +1091,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",