Git development
 help / color / mirror / Atom feed
From: "Shashank S via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
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>
Subject: [PATCH] [Outreachy PATCH] t2403: modernize test for directory existence
Date: Fri, 16 Oct 2026 04:31:51 +0000	[thread overview]
Message-ID: <pull.2259.git.1792125111461.gitgitgadget@gmail.com> (raw)

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

                 reply	other threads:[~2026-10-16  4:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.2259.git.1792125111461.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kaartic.sivaraam@gmail.com \
    --cc=shashu8660@gmail.com \
    --cc=siddharthasthana31@gmail.com \
    --cc=usmanakinyemi202@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox