πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #516

[PATCH v2 7/7] stash: simplify reset_tree() function signature

#516
From: Phillip Wood
Date: Wed, 14 Oct 2026 15:40
46 lines
9481 bytes
From: Phillip Wood <phillip.wood@dunelm.org.uk>

There is only one caller and it does not want to update the worktree or
reset the index so remove those unused parameters.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
---
 builtin/stash.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/builtin/stash.c b/builtin/stash.c
index 55916259c3..bc1252790b 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -332,7 +332,7 @@ static int clear_stash(int argc, const char **argv, const char *prefix,
 	return do_clear_stash();
 }
 
-static int reset_tree(struct object_id *i_tree, int update, int reset)
+static int reset_tree(struct object_id *i_tree)
 {
 	int nr_trees = 1;
 	struct unpack_trees_options opts;
@@ -358,10 +358,6 @@ static int reset_tree(struct object_id *i_tree, int update, int reset)
 	opts.src_index = the_repository->index;
 	opts.dst_index = the_repository->index;
 	opts.merge = 1;
-	opts.reset = reset ? UNPACK_RESET_PROTECT_UNTRACKED : 0;
-	opts.update = update;
-	if (update)
-		opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */
 	opts.fn = oneway_merge;
 
 	if (unpack_trees(nr_trees, t, &opts))
@@ -738,7 +734,7 @@ static enum stash_apply_result do_apply_stash(const char *prefix,
 	}
 
 	if (has_index) {
-		if (reset_tree(&index_tree, 0, 0))
+		if (reset_tree(&index_tree))
 			ret = -1;
 	} else {
 		unstage_changes_unless_new(&c_tree);
-- 
2.56.0.134.g299a3c16181
Technical Details
Message-ID: <db53bf3b57e2bef504ad137fc1d896a2bc840e14.1791992404.git.phillip.wood@dunelm.org.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72029-linux-kernel-git=dewy.ru
References: <cover.1791218125.git.phillip.wood@dunelm.org.uk> <cover.1791992404.git.phillip.wood@dunelm.org.uk>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72029-linux-kernel-git=dewy.ru
From: phillip.wood123@gmail.com (Phillip Wood)
Newsgroups: linux.kernel.git
Subject: [PATCH v2 7/7] stash: simplify reset_tree() function signature
Date: Wed, 14 Oct 2026 16:40:19 +0100
Organization: Usenet Network
Message-ID: <db53bf3b57e2bef504ad137fc1d896a2bc840e14.1791992404.git.phillip.wood@dunelm.org.uk>
References: <cover.1791218125.git.phillip.wood@dunelm.org.uk> <cover.1791992404.git.phillip.wood@dunelm.org.uk>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2326227"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7zEIgeES0WIwG+0vEobb+64fQQ0= sha256:RQYzhlWCbtVB3R6EqaaMRYQJ/YURJjh+Zu9iT2OlmHE=
	sha1:rYtYOB7o9N/YqxamQVRFinIR9dc= sha256:vzaLBVizNtSkAjhiP9q0G/HtO+izuH1GO/MpbG3TyB4=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 7B335110158; Wed, 14 Oct 2026 18:46:45 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.048
X-Spam-Status: No, score=-2.048 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FORGED_GMAIL_RCVD=1,
	FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
	HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Z5q_-4DDUcF7;
	Wed, 14 Oct 2026 18:46:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-72029-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 926D1110103; Wed, 14 Oct 2026 18:46:33 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 057A747779; Wed, 14 Oct 2026 15:41:07 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A97F155C323;
	Wed, 14 Oct 2026 15:40:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nk+RI1ZH"
X-Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1103555D861
	for <git@vger.kernel.org>; Wed, 14 Oct 2026 15:40:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791992448; cv=none; b=d5XTTSqzsvrZcItc+Z+o0V5pFwzs04H7Ax0NpdOyD68PArvBHDXaaX9BpRds0VT5Bz0gHHiHChFyvXsUlAP90FzvawKdiOgJaIiO1yWPQfqeDO5gvi+SgoG6zKGXwvTqbhc4sNZ6D635u15d60aD+aqeLZdRZao9DtRSrAx1V50=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791992448; c=relaxed/simple;
	bh=M/T0O4WFm7werbpQZft8dShuNcxcqEHYgu+hNtWs3G4=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=jCpA9pkabqD5X1VNyykNtV/mqYaqakfCaasu0wLwouq3USVTAcHiQYgN0TeIReVFZGt9rcTEW9eKD+IIJG+VWf5MicvDrvjQ5B1Kj7akjC9lcDy8fEozAsnT6Hq5GYX2loQ9t6ypDyaucjGS8+RflZTeRRQ/6nmwtmKCpb7p5so=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nk+RI1ZH; arc=none smtp.client-ip=209.85.221.48
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-48afe75f055so595682f8f.2
        for <git@vger.kernel.org>; Wed, 14 Oct 2026 08:40:45 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1791992444; x=1792597244; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:reply-to:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=YmBMpzBjUGW8YNW8Rn0paVufGdRLWO7YVdcWv5LCpzw=;
        b=nk+RI1ZH7Pdw+MHXzAb5n+Bz9HaZEkgmLAq29/lkkaygtaXK6RE1oUOg897zhuA5UK
         bIsr5G4jbC25G+vBi3nNAmltyVKAcnuRhVTugwPjVmEFGdwqghME9AW8PMyMqklg3FdZ
         k/xqQL81Wo1P8n58npQ0IaawPl8xO/BtzGQkWKiSADFQgXpdk6/qAnAgxvfWN8RnZRKE
         j24m6lKD+MeBDcHGwgO/LRaf2mkKRQq5miZU50SK1riJclWcdFIl83rAM27VJWNgqS73
         35k+7a5cEbDLikI2gprKc+OBdjJI4cGgWcnLfKyxeHNGbKYVKK0PrGFMrlO1i2O+h2gc
         YVMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1791992444; x=1792597244;
        h=content-transfer-encoding:mime-version:reply-to:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=YmBMpzBjUGW8YNW8Rn0paVufGdRLWO7YVdcWv5LCpzw=;
        b=enLNor50YZMGcqcbJxqcw38L01DJ6318Tfa1JJ6/81cWS2dSKEXFrLiYihCn7MiRCA
         1OVjNBkP5qzR2FrBj/kMusnh1oRe4KabHO7/2nPjR4xlm/T7Hg6G6FHz2o0z0/bdqBHU
         K0bIqr90lMOGJrO5YGHcQ5X6dOrEQBuQ4rgC9Dfbf2/AauyHbPr47zkbKXB2biuFMPvO
         l1CSdR8RKlejltEzmZ9PlPJsqhUmnROtYQl/FpLrdjvdtFIjDO5XVJQdykS11KkwBqhK
         VQZ16bJmJ+9x6qkw8K49PSvhj9QJdJPFCtaNjHq9DVEI0Vax8bSbdgSimyUWL62Jclfv
         j81Q==
X-Gm-Message-State: AFq9FYIRipm7uWFI/dyrElkW8PZ/ig9PWbhk9PhcXOYTRVVTzz6ZLi6W
	Giqm+uJaKYlSqG9A5nNs5434l3eY1HH4v4TzYv3MEiA8H2mhWtD28zhFvgMTFA==
X-Gm-Gg: AYBFou1ONtKNky5QOQuMbf+Eu2smwJX8JmDSRcIM/cWDctW6jP0yCHIsPluHnMismMV
	K4dG3QHA9knlf9fcPRoMioYQEKgaGghR4tA4+jSYimF/xq+dggM09jC4Y0Ck/GbsFyJvEMJxdrX
	xSuN1EZxjZ3W5G44nFm72JIdAXGsRZLDsd7Qgw6/oVCNhadwk42izJ/2LH+IkWFHu1OseS5H3N4
	Og7V2wqSwZitr1WKhp19RGHk6V3upCGvOMDklHG/LE97/58udIVRf9SeXI4y/voJIR5ZRkrFEHB
	aY2ybtZsV6Jp79iDC8u3nYgkIV0KxwouJtFr1X7Hs+GIgz3OZ3c8WXH/oZv/dFupcaIZ4FySGH1
	MkB2hj7BWfC7TmBatqisuBVh6KWzYO5uisDXmciUpaUzmsfQJan5ekU9420l5IYfh6apS2RwBFu
	mtUUR0mzEjwk3U5Od1rOOfpzjhaSXpehhFBVXpm1e7n6ESWgRBJ7CRvL3e461W+VSyV9E/5X458
	e6k/XA7jJWJ
X-Received: by 2002:a5d:588e:0:b0:48d:c186:dcc6 with SMTP id ffacd0b85a97d-48dc186dd62mr26779575f8f.57.1791992443914;
        Wed, 14 Oct 2026 08:40:43 -0700 (PDT)
X-Received: from berwick ([2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48de0967acasm10324829f8f.2.2026.10.14.08.40.42
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 14 Oct 2026 08:40:43 -0700 (PDT)
X-Cc: 重田一聖 <kazumasa.shigeta@kanamei.com>,
	Phillip Wood <phillip.wood123@gmail.com>
X-Mailer: git-send-email 2.56.0.134.g299a3c16181
X-In-Reply-To: <cover.1791992404.git.phillip.wood@dunelm.org.uk>
X-Reply-To: Phillip Wood <phillip.wood@dunelm.org.uk>
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>