πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #907

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

#907
From: Phillip Wood
Date: Tue, 20 Oct 2026 15:20
46 lines
12125 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: <a486a625c95cd7493e9cae424bb3a4fdc35c9e66.1792509606.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-72554-linux-kernel-git=dewy.ru
References: <cover.1791218125.git.phillip.wood@dunelm.org.uk> <cover.1792509606.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-72554-linux-kernel-git=dewy.ru
From: phillip.wood123@gmail.com (Phillip Wood)
Newsgroups: linux.kernel.git
Subject: [PATCH v3 7/7] stash: simplify reset_tree() function signature
Date: Tue, 20 Oct 2026 16:20:42 +0100
Organization: Usenet Network
Message-ID: <a486a625c95cd7493e9cae424bb3a4fdc35c9e66.1792509606.git.phillip.wood@dunelm.org.uk>
References: <cover.1791218125.git.phillip.wood@dunelm.org.uk> <cover.1792509606.git.phillip.wood@dunelm.org.uk>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3883441"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wH4G2x4GYoTTR1uKlkN69kcAc8c= sha256:wBf9wacAeKw80O4o63niAOuJKFxEy7CbUNIgjrbPXJM=
	sha1:/CCgOVlH5cuN7uUf8Ctbv98aLnA= sha256:qPH1Kk/g90q6xzt4oYjTh3NzlmrZ9bMZMWX+NaJyLkU=
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 A5869110C79; Tue, 20 Oct 2026 18:28:29 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.948
X-Spam-Status: No, score=-1.948 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.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 moIlgIGDVT6T;
	Tue, 20 Oct 2026 18:28:26 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-72554-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 D7E69110D4E; Tue, 20 Oct 2026 18:28:17 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 84B7062830; Tue, 20 Oct 2026 15:21:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792509666;
	b=ncLdmSpvjLhb5rerOfdYmXUTZjfiocz8Yx6DTB07EbAG+n+9N2qhGAE/yKXt4LNNrlFX
	 wrpOKdnqupHvvcXLUZ63AENWF7QFcftaXd7uj4GDVLqKr08PCD1jnVGdBDryoxsDKRuB6
	 C9KGbcnKhUagw3kizTTgjiOvBAvIbpwS3XZuIyGL3onuawrEWt1lENOkiYto3MJkyyotv
	 UtggSXHjwMkei12f2Eu7DSRiHeU/8HcxGKqOP3j4XXFvE/Ce13ivOCfNAXsGHnnveLk6l
	 O6i4EkBsj/25JLkI+YsaWYhcKf7Yt1mBHJblvv13Zjaqoqd1/yaXitnix9k8H7HYrhg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792509666;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
	 References:Reply-To:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=YmBMpzBjUGW8YNW8Rn0paVufGdRLWO7YVdcWv5LCpzw=;
	b=gzXCXmUvtlMwbEEFhffBt+6ccoN7nZuHcxo0A1XKvaMTd/WPN+OImyGosHmlarD2de+T
	 5ih3Dn7oJ5j0ypvRwnZ7gAzy5LE5gyE2X6PGvJ4SoC7hlLuPYo+CnOmc4LdYF03ts9tyY
	 WewStEc4bgMmojVH9RfH/CQLo+xUavijOgLTpAKlCl4uxgOydkm89XcHboyXrn2yhKdeM
	 WrVFEHSe4yXIfvpICvmtHxq4EPH8bfgDeMIZP5w3gx9Rtvse+hUOhR301279c+uiQ8F47
	 ziMz+kb6xngyARHggivDc7f9dgz85QPm/I2YhCm+knD7z0VZLU3gKqjnRcZPUJa49sg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=rAZWFs0D;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 76A9B606A321;
	Tue, 20 Oct 2026 15:21:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=rAZWFs0D
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.53
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792509665;
	b=pRbbX2gDaoG/l9WbfWYEFmGT2UV4O122XZRXH9zu0QsB+AnSh9jtmF+U55atzExqwkBs
	 JfBDjFsJbF6urUBPIDD9Mgd7pmkBRJTTOwLgZkdfX2szXGTp2AdCoX2RwWJXXehIt9v1T
	 IVhTIc3L9ozwr0xl9/s0/f5cMdPAHIDxPV58dxY1gN6nTq1oGI3944nISUrEhkLmCARPg
	 bmPoObl9UE74PBEARV7/Cnwzi7z4DrOUkRzgAsrf8XuSd2o+6KMM5s6GBSggYJFbKRbbu
	 /SRI4kRC1nlQo2nSk+G5Njo3IQg6N9jBft3Nl2PCE7ST+DV5ipgN2vQpSvySiW8hjMw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792509665;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:Reply-To:MIME-Version:
	 Content-Transfer-Encoding;
	bh=YmBMpzBjUGW8YNW8Rn0paVufGdRLWO7YVdcWv5LCpzw=;
	b=Q03CqKcw7bTrkmWDyvoh9fbcOkFEP8SMoXemcf+1QX6XA/hwC/fY5wTQs1s794PyawnX
	 ub5FQ2Oewpoe/CbvCnKpnIbnyzh9Hv06ybYa9rTG9uJDcdm+u7oz8Z2JMr8PEiJO6C0Rq
	 2ZDKvH8zOJtfoSPndvYMarggjK/9J8edjqHH2m0L4R9RAk/eJJFUsQHO44HQIdCxYpgap
	 Dp5hBygVNnUqBGAFANJzUSQb3fD7QMTGe36LuyDulyBchV/mo9dR9JUqINGmHidck/kq7
	 KQOLVT8HYZ/0wldf0GOwZg1gM3s9d0qRkqrdIJg/Cyo8Q7JyQjoWEiqGGjgpf9JW+zA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=rAZWFs0D;
	arc=none smtp.remote-ip=209.85.221.53
X-Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A546606A33C
	for <git@vger.kernel.org>; Tue, 20 Oct 2026 15:21:05 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4A546606A33C
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-f53.google.com with SMTP id ffacd0b85a97d-48df8fe8513so2936832f8f.0
        for <git@vger.kernel.org>; Tue, 20 Oct 2026 08:21:05 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792509664; x=1793114464; 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=rAZWFs0DDfW5R766BevygVWBynp0E+848xn9lkvOzcVW7svgNOojGRz1eJDcHpYBbG
         BvFk+9UrLL7oI3z8VUdYAIs13XgVb5N2k2f2Y0qP+7WpIC59Pg8Lry+WXDlf4XfFwhWv
         fb7gLSt8nzZ3hgnez4PeibTDvqWIZJFe9Ith3CgeIOJ8WDOm6XWNpNMTDWKenO0RHKtE
         89tZBT7XZISA3g8Dqr1O/roKCXjY93vG52FCAFQSfAjTk4YJgkGcSZ+s8KQcTkBY3oM2
         gE2s3kvayJSU2WEK8Zp/9cTILsSCC4p/P2atUaELrLvjoGliXwVM2hG/gJ4XJXt8EPy3
         JmAw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792509664; x=1793114464;
        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=NaA1MWAD2Obbbyv3WzlwxuHrYNGDw03VTH+jn33k39xl412JA7Mr+O1cJmrZzxdmVb
         BYo6Gvz7TaE3EV1jRoz8oFWENkfAILHgAJVepaF5XYJ+whw+9mZT6sb1iZqQuYL1l7HR
         cyTGDrOXWEfmIhek1ZEmkCzjOnk9w6FlOkUmNDbAaMZ6uYoOXYwTBTcQ3Gues3FwXL7m
         JdnvrrMKFgSi4+EQpJiUD21ebXjFJ1rSvYQhuPJ3UCp0tWDxPyfwEjrJv4EkKNhbytlw
         IV4/MResV2A0Zt4KSWetUtFsqpzg5p4qlqu/C0c/SKxE9TsJST825quQ40k9SjR0kgUj
         dN2Q==
X-Gm-Message-State: AFq9FYJzeKv8KuGTuxQ1GjWWbvIuMz5ueonoA9LZvQ/mKO4Duzu4TYQr
	bPLWZqpSfZ898sgYeh6yAiK7AdkwjyXc/3UpWgM3qFT4jf/GxRoTiWHhd3PZjQ==
X-Gm-Gg: AYBFou1LBPriGPncI5BtYhAN3+5mBi3BMVuJTs6ViMlXlPxUUsOlaIe4o1GCY3oqoHd
	A7b6Kt05kkzJOyX5s9RyxSvtyJUltWx//WSZgU6TSHXD2aj80hTuSGQQhNCxt0ZSj+gN6BC4pTi
	VlxnzFHufq0/fqCRCOy2ZueRqgr77Cn0eB6KaGBRsad+eXYCG0tH2IVRztkzhyKHWT/oiHcGv9D
	7J2JDP7FFZaZZq9v7NYpVmJUf21lhJNj57awB2vjvws/VxH0JHHSxjKchhwTcWLnmvb6W5xWuGs
	d5gzShTkHrLrRwlJ9bFy8GveWzZszo9tYWwAxVKZs+8Uwu7HdWeFODn593T1f/fotRRO++gU5ov
	pl0pr9mxG+kffkuU8u6fKxP/blDlfn+H8RraKe6qnam0WnkTRw19UF4UrrO7RmL/pHt0SJnhidP
	cZAe3G09KFRq+vRz0ivmJoIKQyRGxxaJl/qF1dSit67ub5KOLo5BVscuWbE3QLe4+ru6Se5fQQ9
	g==
X-Received: by 2002:a05:6000:29ca:b0:48e:a9:9e2e with SMTP id ffacd0b85a97d-48e07bb315cmr16779253f8f.14.1792509663372;
        Tue, 20 Oct 2026 08:21:03 -0700 (PDT)
X-Received: from berwick ([2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e1d823ca7sm6307355f8f.38.2026.10.20.08.21.02
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 20 Oct 2026 08:21:02 -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.1792509606.git.phillip.wood@dunelm.org.uk>
X-Reply-To: Phillip Wood <phillip.wood@dunelm.org.uk>
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list