Skip to content

Commit 212ab23

Browse files
thaliaarchigitster
authored andcommitted
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 a8dd2e7 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b5062f7 commit 212ab23

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

builtin/fast-import.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,7 +2448,6 @@ static void file_change_cr(const char *p, struct branch *b, int rename)
24482448

24492449
static void note_change_n(const char *p, struct branch *b, unsigned char *old_fanout)
24502450
{
2451-
static struct strbuf uq = STRBUF_INIT;
24522451
struct object_entry *oe;
24532452
struct branch *s;
24542453
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
25132512
die("Invalid ref name or SHA1 expression: %s", p);
25142513

25152514
if (inline_data) {
2516-
if (p != uq.buf) {
2517-
strbuf_addstr(&uq, p);
2518-
p = uq.buf;
2519-
}
25202515
read_next_command();
25212516
parse_and_store_blob(&last_blob, &oid, 0);
25222517
} else if (oe) {

0 commit comments

Comments
 (0)