From: Zakariyah Ali <zakariyahali100@gmail.com>
To: git@vger.kernel.org
Cc: ayu.chandekar@gmail.com, christian.couder@gmail.com,
jltobler@gmail.com, karthik.188@gmail.com,
siddharthasthana31@gmail.com,
Zakariyah Ali <zakariyahali100@gmail.com>
Subject: [GSoC PATCH v2] t2000: modernize path checks with test_path_is_* helpers
Date: Thu, 26 Mar 2026 20:26:03 +0100 [thread overview]
Message-ID: <20260326192603.23961-1-zakariyahali100@gmail.com> (raw)
In-Reply-To: <CAPAKoce5BeXMPtok+dni+WDTkokCAq0o4uMHGg1KZto9-UniXQ@mail.gmail.com>
Replace bare 'test -f/-d' and 'test ! -h' assertions with dedicated
helpers. These helpers report loudly what expectation wasn't met,
therefore making debugging easier.
Signed-off-by: Zakariyah Ali <zakariyahali100@gmail.com>
---
t/t2000-conflict-when-checking-files-out.sh | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/t/t2000-conflict-when-checking-files-out.sh b/t/t2000-conflict-when-checking-files-out.sh
index f18616ad2b..96bae6c53d 100755
--- a/t/t2000-conflict-when-checking-files-out.sh
+++ b/t/t2000-conflict-when-checking-files-out.sh
@@ -58,7 +58,9 @@ test_expect_success \
test_expect_success \
'git checkout-index conflicting paths.' \
- 'test -f path0 && test -d path1 && test -f path1/file1'
+ 'test_path_is_file path0 &&
+ test_path_is_dir path1 &&
+ test_path_is_file path1/file1'
test_expect_success SYMLINKS 'checkout-index -f twice with --prefix' '
mkdir -p tar/get &&
@@ -127,9 +129,9 @@ test_debug 'show_files $tree2'
test_expect_success \
'checking out conflicting path with -f' \
- 'test ! -h path2 && test -d path2 &&
- test ! -h path3 && test -d path3 &&
- test ! -h path2/file0 && test -f path2/file0 &&
- test ! -h path3/file1 && test -f path3/file1'
+ 'test_path_is_dir_not_symlink path2 &&
+ test_path_is_dir_not_symlink path3 &&
+ test_path_is_file_not_symlink path2/file0 &&
+ test_path_is_file_not_symlink path3/file1'
test_done
--
2.43.0
next prev parent reply other threads:[~2026-03-26 19:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 0:15 Github Patch Zakariyah Ali
2026-03-26 0:54 ` Pablo
2026-03-26 19:26 ` Zakariyah Ali [this message]
2026-03-26 20:29 ` [GSoC PATCH v2] t2000: modernize path checks with test_path_is_* helpers Junio C Hamano
2026-03-27 23:40 ` [GSoC][PATCH v3] t2000: modernise overall structure Zakariyah Ali
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=20260326192603.23961-1-zakariyahali100@gmail.com \
--to=zakariyahali100@gmail.com \
--cc=ayu.chandekar@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=jltobler@gmail.com \
--cc=karthik.188@gmail.com \
--cc=siddharthasthana31@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