From patchwork Mon Apr 1 09:03:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thalia Archibald X-Patchwork-Id: 13612633 Received: from mail-4317.proton.ch (mail-4317.proton.ch [185.70.43.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF6A6DDD9 for ; Mon, 1 Apr 2024 09:03:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711962217; cv=none; b=QswQE3ErbUE3OQO6oUEcSTu5HKS+uCXZeBXyafIPpAflvaIs00Atq3r72MSatjNeQilfd0rZJ8ze1kyAhPQkauEnaF1lc+Kly5HW2S4uJA6JhxBchEVHgf9+elWN7ZNMm4cQ4TjN//Dw1Aaq9CVV8aHqSZXSt5VrzLVKyWi0V7A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711962217; c=relaxed/simple; bh=qd8TlIaNuav2xetbnliokn0aFyCHjRofZL/i5SeubgU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TUH7MOHYMhwXZHz+0DD/D9GLcUJmsbi2RwsgpXNA/JB2WrstNpdd0Ok0DHB+/Knf1CxZGWxkBYjCqHU0WpxaVvydwwXbLXS+eynuSiB9G+yU/GIcRQp/UkjHiwrpkMknsADrBkttVryI1PzjGZOtrzdkuOPun0PqkB4VfnESBsM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=archibald.dev; spf=pass smtp.mailfrom=archibald.dev; dkim=pass (2048-bit key) header.d=archibald.dev header.i=@archibald.dev header.b=EiZFdyQN; arc=none smtp.client-ip=185.70.43.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=archibald.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=archibald.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=archibald.dev header.i=@archibald.dev header.b="EiZFdyQN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archibald.dev; s=protonmail3; t=1711962212; x=1712221412; bh=qd8TlIaNuav2xetbnliokn0aFyCHjRofZL/i5SeubgU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=EiZFdyQNiLKdQmnpWbsQjYDMGTdlQHU75kOECGRFxUmWhWCzyJUilDRsTbJ5P59lM 430ja5n1/SIK88rtqIodY4ZQC6C046TPKp4ZCFgF/83b5tiq43Kz5UemfIEBwd5fin yh7j/ovsM8NEo+t/UNCnmofYIcYjeZSbPR2yAmiSI39aQE/P0QWeyxfzosSDuOyLt+ IfHWX/e+2upVeCLxBT198vB5BOZTQbsavJXZ9X0/MtBX3Cg2f/GmtLUdm+cQT53Rr8 oKyIrYBHkyS+u430IWMPrcwWYUE2iXPDIVLoOqkYfY0IyH9JfMW8jV/ubacyQLI9/q sWJwkF6lmbbRA== Date: Mon, 01 Apr 2024 09:03:25 +0000 To: git@vger.kernel.org From: Thalia Archibald Cc: Patrick Steinhardt , Elijah Newren , Thalia Archibald Subject: [PATCH v2 4/8] fast-import: remove dead strbuf Message-ID: In-Reply-To: References: <20240322000304.76810-1-thalia@archibald.dev> Feedback-ID: 63908566:user:proton Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- builtin/fast-import.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/builtin/fast-import.c b/builtin/fast-import.c index 58cc8d4ede..fc6eeaf89c 100644 --- a/builtin/fast-import.c +++ b/builtin/fast-import.c @@ -2442,7 +2442,6 @@ static void file_change_cr(const char *p, struct branch *b, int rename) static void note_change_n(const char *p, struct branch *b, unsigned char *old_fanout) { - static struct strbuf uq = STRBUF_INIT; struct object_entry *oe; struct branch *s; struct object_id oid, commit_oid; @@ -2507,10 +2506,6 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa die("Invalid ref name or SHA1 expression: %s", p); if (inline_data) { - if (p != uq.buf) { - strbuf_addstr(&uq, p); - p = uq.buf; - } read_next_command(); parse_and_store_blob(&last_blob, &oid, 0); } else if (oe) {