@matheusbsbs / matheus-bagliano / commits / 90d0571357
Fork 0

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>

Tay Ray Chuan committed Apr 19, 2010 at 22:46 UTC 90d05713575ea6ed21d05228bcda8461f7b28ccf
1 file changed +2 -3
http.c
+2 -3
@@ -1077,7 +1077,6 @@ int finish_http_pack_request(struct http_pack_request *preq)
1077 struct http_pack_request *new_http_pack_request(
1078 struct packed_git *target, const char *base_url)
1079 {
1080 - char *filename;
1080 long prev_posn = 0;
1081 char range[RANGE_HEADER_SIZE];
1082 struct strbuf buf = STRBUF_INIT;
@@ -1092,8 +1091,8 @@ struct http_pack_request *new_http_pack_request(
1091 sha1_to_hex(target->sha1));
1092 preq->url = strbuf_detach(&buf, NULL);
1093
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));
1096 preq->packfile = fopen(preq->tmpfile, "a");
1097 if (!preq->packfile) {
1098 error("Unable to open local file %s for pack",