Skip to content

Commit

Permalink
http.c::new_http_pack_request: do away with the temp variable filename
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tay Ray Chuan authored and Junio C Hamano committed Apr 20, 2010
1 parent 750ef42 commit 90d0571
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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",
Expand Down

0 comments on commit 90d0571

Please sign in to comment.