Skip to content

Commit 90d0571

Browse files
rctaygitster
authored andcommitted
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 <[email protected]> Acked-by: Shawn O. Pearce <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 750ef42 commit 90d0571

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

http.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,6 @@ int finish_http_pack_request(struct http_pack_request *preq)
10771077
struct http_pack_request *new_http_pack_request(
10781078
struct packed_git *target, const char *base_url)
10791079
{
1080-
char *filename;
10811080
long prev_posn = 0;
10821081
char range[RANGE_HEADER_SIZE];
10831082
struct strbuf buf = STRBUF_INIT;
@@ -1092,8 +1091,8 @@ struct http_pack_request *new_http_pack_request(
10921091
sha1_to_hex(target->sha1));
10931092
preq->url = strbuf_detach(&buf, NULL);
10941093

1095-
filename = sha1_pack_name(target->sha1);
1096-
snprintf(preq->tmpfile, sizeof(preq->tmpfile), "%s.temp", filename);
1094+
snprintf(preq->tmpfile, sizeof(preq->tmpfile), "%s.temp",
1095+
sha1_pack_name(target->sha1));
10971096
preq->packfile = fopen(preq->tmpfile, "a");
10981097
if (!preq->packfile) {
10991098
error("Unable to open local file %s for pack",

0 commit comments

Comments
 (0)