🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #645

[PATCH] [Outreachy PATCH] t2403: modernize test for directory existence

#645
From: "Shashank S via GitGitGadget"
Date: Fri, 16 Oct 2026 04:31
47 lines
9703 bytes
From: Shashank <shashu8660@gmail.com>

Replace the old-style shell `test -d` commands with Git's modern
`test_path_is_dir` helper function.

This provides better debugging output if the tests were to fail,
as the helper prints a clear error message rather than just failing
silently like `test -d` does.

Signed-off-by: Shashank <shashu8660@gmail.com>
---
    [Outreachy PATCH] t2403: modernize test for directory existence

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2259%2Fshashu8660%2Foutreachy1-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2259/shashu8660/outreachy1-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2259

 t/t2403-worktree-move.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t2403-worktree-move.sh b/t/t2403-worktree-move.sh
index 69768c1207..85793f9460 100755
--- a/t/t2403-worktree-move.sh
+++ b/t/t2403-worktree-move.sh
@@ -182,7 +182,7 @@ test_expect_success 'force remove worktree with untracked file' '
 
 test_expect_success 'remove missing worktree' '
 	git worktree add to-be-gone &&
-	test -d .git/worktrees/to-be-gone &&
+	test_path_is_dir .git/worktrees/to-be-gone &&
 	mv to-be-gone gone &&
 	git worktree remove to-be-gone &&
 	test_path_is_missing .git/worktrees/to-be-gone
@@ -191,7 +191,7 @@ test_expect_success 'remove missing worktree' '
 test_expect_success 'NOT remove missing-but-locked worktree' '
 	git worktree add gone-but-locked &&
 	git worktree lock gone-but-locked &&
-	test -d .git/worktrees/gone-but-locked &&
+	test_path_is_dir .git/worktrees/gone-but-locked &&
 	mv gone-but-locked really-gone-now &&
 	test_must_fail git worktree remove gone-but-locked &&
 	test_path_is_dir .git/worktrees/gone-but-locked

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
-- 
gitgitgadget
Technical Details
Message-ID: <pull.2259.git.1792125111461.gitgitgadget@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72195-linux-kernel-git=dewy.ru

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-72195-linux-kernel-git=dewy.ru
From: gitgitgadget@gmail.com ("Shashank S via GitGitGadget")
Newsgroups: linux.kernel.git
Subject: [PATCH] [Outreachy PATCH] t2403: modernize test for directory
 existence
Date: Fri, 16 Oct 2026 04:31:51 +0000
Organization: Usenet Network
Message-ID: <pull.2259.git.1792125111461.gitgitgadget@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2685443"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Pfq1UT03zQygFeqpe7hDnXHwguA= sha256:slhtJCqbiLlXVgYwpOrkruC8Sa8vH2mUr1KtPgiG7d4=
	sha1:nibLdKUuMuUuIJGCw2i1UQYnHV0= sha256:B8O+2dl0mTvTXsPB4wdNYXWCtqprNIMazG2NXmxNpAs=
List-ID: <git.vger.kernel.org>
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id AAAFB110462; Fri, 16 Oct 2026 07:34:11 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: 3.91
X-Spam-Level: ***
X-Spam-Status: No, score=3.91 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_SBL_CSS=3.558, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=no 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 x9vhTq0sl3vr;
	Fri, 16 Oct 2026 07:34:04 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-72195-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 5148711042E; Fri, 16 Oct 2026 07:33:55 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id C16A641952; Fri, 16 Oct 2026 04:31:59 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 164C330ACE3;
	Fri, 16 Oct 2026 04:31:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Vq69WICO"
X-Received: from mail-dy1-f171.google.com (mail-dy1-f171.google.com [74.125.82.171])
	(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 37E1B38B7AA
	for <git@vger.kernel.org>; Fri, 16 Oct 2026 04:31:56 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.171
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792125117; cv=none; b=Icn/dOTj+himqwYY0lCYacSixIEae9A4Aj110LOXHBrdqsb/XcJ8dJMyoG63gZnwGdCzCy29ARBSj0Bi8QOYVWiorNbNBTmp1WdjhoMRDEoov1Vmg5OUV31asnahMNNb1csc+MEZVCJJ5ilOWhPKVSUIWL182ZGLQoA1gcTR1tE=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792125117; c=relaxed/simple;
	bh=ipo+rf5bnFpjITlicaSGyM36HfTQpfTubBOGcNQN2JM=;
	h=Message-Id:From:Date:Subject:Content-Type:MIME-Version:To:Cc; b=M63rLIGKDL1Hb4JgPSYA7TemV21/eJ2tsGOCbgaaXCR7/MQinOzuprvA43sS/TF9uRixczE82ItWGnM3K7JOwMp7mP8OhuITLYFppE03Cv38NXhkZkL9JoJOPnd0FQmL1G02B9wepQkiov4fRY5UhQlg4kftKVEcUHmFxTryXAE=
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=Vq69WICO; arc=none smtp.client-ip=74.125.82.171
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-dy1-f171.google.com with SMTP id 5a478bee46e88-35ef6b49813so3364453eec.0
        for <git@vger.kernel.org>; Thu, 15 Oct 2026 21:31:55 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792125115; x=1792729915; darn=vger.kernel.org;
        h=cc:to:mime-version:content-transfer-encoding:content-type:fcc
         :subject:date:from:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=PinLiH3IEzEymzyz1xpBtJy7z+PSmNPYoaUca7H9YaQ=;
        b=Vq69WICOJ9qkAeOdIHXLD80FchRasrSzqeGIxkuYuiEhjhs9s6K32+o1n5FsRhVBLN
         /ifu+ggPKyEbgibQXHkWXfkzvet8QOWv3I0A7hiFxZrBO0JvzBadlKZ1m6GdJcmm6NgB
         z0RgLwiFFLUenRg1BSgNqyg/bPV99ybM2T5kB/NTV9s+JasxEyVOZK7HdZuZSdpca7aX
         jI7qiz2ZU/XL2b7XCGWws9spmTvmlpbwKj9NnULivvBBo4teOnilT0DSS49/75zhlA0C
         GRdh1fbgZc2CG86ulmgoomRf7GS84vFVljb4eqiYs+T1uj+yW0FKZsi4oTDpwJ/IGNdY
         ltzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792125115; x=1792729915;
        h=cc:to:mime-version:content-transfer-encoding:content-type:fcc
         :subject:date:from:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=PinLiH3IEzEymzyz1xpBtJy7z+PSmNPYoaUca7H9YaQ=;
        b=XFV+3zJ6IM8mHwZFZrHA1DR5rssFNdYARAw3rCy2Gnv8N9u54DWvwOnxy8ALzlbmCJ
         E2DNxILXgKBV328AOBpvFTNlR+VFmG4kXHXO50FavmaLO2CH4uzxmVlx/ADUTBIP78mi
         qxgWA6u829sU4Z/0SqBS6Pit5CNil0g6I7SH9/ErhR+Y18vqI/saGrxbz642KTkMOYXN
         8UyKU+udm6wyUOCKi5b+tMvZG9WatTiC7YJWa/bQb6sodNkbyTICsUzgqfcOgPp3TLuW
         Zx9Ro63mTv56V3H3XAd5LOgiyv3mH8ljhsX2635dfovP+p/aJZ3SJR/eQe+wyLrDcGwJ
         QeQQ==
X-Gm-Message-State: AFq9FYJqIfKeoEegzti1zOGdzQUMVtrMUwxlDByF0fXB4aBBMQLNIrUg
	96VJr3bu7W4tUVbk/4M8LCqKfFKZmd/lTGNPjR16pK7y78q4L0TJIgBkOXTnyQ==
X-Gm-Gg: AYBFou1lce6tbPu6hvKq6I//Gp5S2K4IiUwQusqDXfg0PkO/CUWJCJmgewoQcaQp/ph
	N4zUzMuWDe2r13lN9GJa9MD1VG6n8asUhLyY3pGwPPIs6lHRNckAJvgaIMV/oBkXEWtIo0+34N/
	reRI+m7V05gMchBuJp1eKM2hHosixNbRP+OAKz862wPghXFAAU5R9wYG42Wz1HlcbQ8UtFg2Dpk
	bnmM3h3uaVfc53QCRh169Bwfw/jRgE6sqVv7F3Mr9yKZKV3Akn5w0YLl8dQ3A6VL8DCoEwVueMs
	Oqt7vK8y5yv1rhWvNubQMX/4GThHKDuMSBClOgIgeb9B2pG5juBs1R8cbG5lKsWG+YjgfkOWXmD
	WEakWUu/19tyYH9ncyr47rtab9Rvcmod/4Wak2g+EkfMUJqF3nMFJszBj3MV9TSg1B388M6QrYq
	4GR1UYvE9ooAOd8nnpuPmdQTGgXri3HdTkd6J6iemzvLxxf4avqmslDkByVPq0DS6CGnGbI51c
X-Received: by 2002:a05:7022:7e08:b0:144:fdf0:9d91 with SMTP id a92af1059eb24-16a61695832mr39040568c88.24.1792125115039;
        Thu, 15 Oct 2026 21:31:55 -0700 (PDT)
X-Received: from [127.0.0.1] ([52.161.178.32])
        by smtp.gmail.com with ESMTPSA id a92af1059eb24-1831a6f5a13sm2448409c88.12.2026.10.15.21.31.52
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 15 Oct 2026 21:31:52 -0700 (PDT)
X-Fcc: Sent
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>
X-Cc: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>,
    Christian Couder <christian.couder@gmail.com>,
    Siddharth Asthana <siddharthasthana31@gmail.com>,
    Usman Akinyemi <usmanakinyemi202@gmail.com>,
    Junio C Hamano <gitster@pobox.com>,
    Shashank S <shashu8660@gmail.com>,
    Shashank <shashu8660@gmail.com>