fast-import: remove dead strbuf
The strbuf in `note_change_n` is to copy the remainder of `p` before potentially invalidating it when reading the next line. However, `p` is not used after that point. It has been unused since the function was created in a8dd2e7d2b (fast-import: Add support for importing commit notes, 2009-10-09) and looks to be a fossil from adapting `file_change_m`. Remove it. Signed-off-by: Thalia Archibald <thalia@archibald.dev> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thalia Archibald committed
Apr 14, 2024 at 01:11 UTC
212ab23e98546b24a183dce86b90595e1e4b92dd
1 file changed
-5
builtin/fast-import.c
-5
@@ -2448,7 +2448,6 @@ static void file_change_cr(const char *p, struct branch *b, int rename)
2448
2449
static void note_change_n(const char *p, struct branch *b, unsigned char *old_fanout)
2450
{
2451
- static struct strbuf uq = STRBUF_INIT;
2451
struct object_entry *oe;
2452
struct branch *s;
2453
struct object_id oid, commit_oid;
@@ -2513,10 +2512,6 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa
2512
die("Invalid ref name or SHA1 expression: %s", p);
2513
2514
if (inline_data) {
2516
- if (p != uq.buf) {
2517
- strbuf_addstr(&uq, p);
2518
- p = uq.buf;
2519
- }
2515
read_next_command();
2516
parse_and_store_blob(&last_blob, &oid, 0);
2517
} else if (oe) {