# [PATCH] t2030: modernize test path checks

8 messages from 2026-10-14 to 2026-10-18. Participants: Srujith A Poojary via GitGitGadget, Harald Nordgren, Srujith Poojary, Usman Akinyemi.
Thread: https://gitlist.dev/t/66534

## Srujith A Poojary via GitGitGadget, 2026-10-14 11:52

Subject: [PATCH] t2030: modernize test path checks
Message-ID: <pull.2256.git.1791978767497.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.2256.git.1791978767497.gitgitgadget%40gmail.com

```
From: Srujith Poojary <poojarysrujith@gmail.com>

Replace old-style file checks with test_path_is_file and the helper
test_path_is_missing for clearer failure diagnostics in test output.

Search with: git grep "test -[efd]" t/

Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>
---
    t2030: modernize test path checks

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2256%2Fpoojarysrujith%2Fmicroproject-modernize-path-check-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2256/poojarysrujith/microproject-modernize-path-check-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2256

 t/t2030-unresolve-info.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 9af24b1204..56a7f849d6 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -170,7 +170,7 @@ test_expect_success 'rerere and rerere forget' '
 	git rerere &&
 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
 	rerere_id=${rerere_id%/postimage} &&
-	test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
 	git checkout -m fi/le &&
 	echo resurrect the conflict &&
 	test_grep "^=======" fi/le &&
@@ -182,7 +182,7 @@ test_expect_success 'rerere and rerere forget' '
 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
 	test -z "$(git ls-files -u)" &&
 	git rerere forget fi/le &&
-	! test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
 	tr "\0" "\n" <.git/MERGE_RR >actual &&
 	echo "$rerere_id	fi/le" >expect &&
 	test_cmp expect actual

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
-- 
gitgitgadget


```

## Srujith A Poojary via GitGitGadget, 2026-10-16 07:25

Subject: [PATCH v2] [Outreachy PATCH] t2030: modernize test path checks
Message-ID: <pull.2256.v2.git.1792135548923.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.2256.v2.git.1792135548923.gitgitgadget%40gmail.com
In-Reply-To: <pull.2256.git.1791978767497.gitgitgadget@gmail.com>

```
From: Srujith Poojary <poojarysrujith@gmail.com>

Replace old-style file checks with test_path_is_file and the helper

test_path_is_missing for clearer failure diagnostics in test output.

Search with: git grep "test -[efd]" t/

Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>
---
    t2030: modernize test path checks

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2256%2Fpoojarysrujith%2Fmicroproject-modernize-path-check-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2256/poojarysrujith/microproject-modernize-path-check-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/2256

Range-diff vs v1:

 1:  641b9330c9 ! 1:  93cf6c12f4 t2030: modernize test path checks
     @@ Metadata
      Author: Srujith Poojary <poojarysrujith@gmail.com>
      
       ## Commit message ##
     -    t2030: modernize test path checks
     +    [Outreachy PATCH] t2030: modernize test path checks
      
          Replace old-style file checks with test_path_is_file and the helper
     +
          test_path_is_missing for clearer failure diagnostics in test output.
      
          Search with: git grep "test -[efd]" t/


 t/t2030-unresolve-info.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 9af24b1204..56a7f849d6 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -170,7 +170,7 @@ test_expect_success 'rerere and rerere forget' '
 	git rerere &&
 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
 	rerere_id=${rerere_id%/postimage} &&
-	test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
 	git checkout -m fi/le &&
 	echo resurrect the conflict &&
 	test_grep "^=======" fi/le &&
@@ -182,7 +182,7 @@ test_expect_success 'rerere and rerere forget' '
 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
 	test -z "$(git ls-files -u)" &&
 	git rerere forget fi/le &&
-	! test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
 	tr "\0" "\n" <.git/MERGE_RR >actual &&
 	echo "$rerere_id	fi/le" >expect &&
 	test_cmp expect actual

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
-- 
gitgitgadget


```

## Harald Nordgren, 2026-10-16 08:36

Subject: Re: [PATCH v2] [Outreachy PATCH] t2030: modernize test path checks
Message-ID: <CAHwyqnWT9f0FvthhsPcRb+c7j7xb1LBxGxxBheb_ddfcUqij+A@mail.gmail.com>
URL: https://gitlist.dev/e/CAHwyqnWT9f0FvthhsPcRb%2Bc7j7xb1LBxGxxBheb_ddfcUqij%2BA%40mail.gmail.com
In-Reply-To: <pull.2256.v2.git.1792135548923.gitgitgadget@gmail.com>

```
> +       test_path_is_file .git/rr-cache/$rerere_id/postimage &&
>         git checkout -m fi/le &&
>         echo resurrect the conflict &&
>         test_grep "^=======" fi/le &&
> @@ -182,7 +182,7 @@ test_expect_success 'rerere and rerere forget' '
>         check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
>         test -z "$(git ls-files -u)" &&
>         git rerere forget fi/le &&
> -       ! test -f .git/rr-cache/$rerere_id/postimage &&
> +       test_path_is_missing .git/rr-cache/$rerere_id/postimage &&

Seems like a good change, but there are lots of these calls in the
codebase. Maybe change the others ones too, while you're at it?


Harald


```

## Srujith Poojary, 2026-10-16 08:50

Subject: Re: [PATCH v2] [Outreachy PATCH] t2030: modernize test path checks
Message-ID: <CABh_KWi-MkiTY56LOLdaZu1dxxYjkSNX3jjO8+9_+mp3-FaNkg@mail.gmail.com>
URL: https://gitlist.dev/e/CABh_KWi-MkiTY56LOLdaZu1dxxYjkSNX3jjO8%2B9_%2Bmp3-FaNkg%40mail.gmail.com
In-Reply-To: <CAHwyqnWT9f0FvthhsPcRb+c7j7xb1LBxGxxBheb_ddfcUqij+A@mail.gmail.com>

```
Hi Harald,

Thanks for taking a look at my patch!
Since this is for an Outreachy microproject, I kept the scope small to
follow the guidelines. But I completely understand—if it helps, I can
take a look at modernizing some of the other ones too in a separate
patch.

Thanks,
Srujith A Poojary

On Fri, Oct 16, 2026 at 2:06 PM Harald Nordgren
<haraldnordgren@gmail.com> wrote:
>
> > +       test_path_is_file .git/rr-cache/$rerere_id/postimage &&
> >         git checkout -m fi/le &&
> >         echo resurrect the conflict &&
> >         test_grep "^=======" fi/le &&
> > @@ -182,7 +182,7 @@ test_expect_success 'rerere and rerere forget' '
> >         check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
> >         test -z "$(git ls-files -u)" &&
> >         git rerere forget fi/le &&
> > -       ! test -f .git/rr-cache/$rerere_id/postimage &&
> > +       test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
>
> Seems like a good change, but there are lots of these calls in the
> codebase. Maybe change the others ones too, while you're at it?
>
>
> Harald


```

## Usman Akinyemi, 2026-10-16 09:18

Subject: Re: [PATCH v2] [Outreachy PATCH] t2030: modernize test path checks
Message-ID: <CAPSxiM9rW9mLdUVjMF9dVYNAPj+FFRShqFrbikqXmbPxd+RSxQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAPSxiM9rW9mLdUVjMF9dVYNAPj%2BFFRShqFrbikqXmbPxd%2BRSxQ%40mail.gmail.com
In-Reply-To: <pull.2256.v2.git.1792135548923.gitgitgadget@gmail.com>

```
>
> test_path_is_missing for clearer failure diagnostics in test output.
>
> Search with: git grep "test -[efd]" t/
Please, remove this, it is not needed and kindly go through other
comments on other Outreachy applicant patches.
>
> Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>
> ---
>     t2030: modernize test path checks

> Range-diff vs v1:
>
>  1:  641b9330c9 ! 1:  93cf6c12f4 t2030: modernize test path checks

I will also advise that whenever you are sending your patches or
sending any query, kindly cc'ed
the mentors for visibility purposes.

Thanks for your interest in the Git project.

Usman


```

## Usman Akinyemi, 2026-10-16 09:35

Subject: Re: [PATCH v2] [Outreachy PATCH] t2030: modernize test path checks
Message-ID: <CAPSxiM8N4MjXpXjryxhx4170gEEQS6mfZu3+MQQ-1iRaFrxibQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAPSxiM8N4MjXpXjryxhx4170gEEQS6mfZu3%2BMQQ-1iRaFrxibQ%40mail.gmail.com
In-Reply-To: <CABh_KWi-MkiTY56LOLdaZu1dxxYjkSNX3jjO8+9_+mp3-FaNkg@mail.gmail.com>

```
> Thanks for taking a look at my patch!
> Since this is for an Outreachy microproject, I kept the scope small to
> follow the guidelines. But I completely understand—if it helps, I can
> take a look at modernizing some of the other ones too in a separate
> patch.
Firstly, do not toppost when replying to a message at Git. Use inline comments.
While the guidelines talked about keeping the changes small, which is valid.
But, that file has about four instances of the same "test -f", that is
not a big change.
You can change all of those instances.

The main idea of Microproject is to get you familiar with the Git workflow.
> >
> > Seems like a good change, but there are lots of these calls in the
> > codebase. Maybe change the others ones too, while you're at it?
Valid.
> >
> >
> > Harald
Thanks at Harald for the review.

Thanks.

Usman.


```

## Srujith Poojary, 2026-10-16 10:16

Subject: Re: [PATCH v2] [Outreachy PATCH] t2030: modernize test path checks
Message-ID: <CABh_KWg58zWEBL-FydbOy5L31_datHfhXih5kcs1rge1a1LHng@mail.gmail.com>
URL: https://gitlist.dev/e/CABh_KWg58zWEBL-FydbOy5L31_datHfhXih5kcs1rge1a1LHng%40mail.gmail.com
In-Reply-To: <CAPSxiM8N4MjXpXjryxhx4170gEEQS6mfZu3+MQQ-1iRaFrxibQ@mail.gmail.com>

```
Hi Usman,

Thanks for the feedback!

Got it—I will remove the search command and update all four instances
of test -f in that file, and I'll make sure to use inline replies and
CC mentors going forward.

I'll send out the v3 patch shortly.

Thanks,
Srujith A Poojary

On Fri, Oct 16, 2026 at 3:06 PM Usman Akinyemi
<usmanakinyemi202@gmail.com> wrote:
>
> > Thanks for taking a look at my patch!
> > Since this is for an Outreachy microproject, I kept the scope small to
> > follow the guidelines. But I completely understand—if it helps, I can
> > take a look at modernizing some of the other ones too in a separate
> > patch.
> Firstly, do not toppost when replying to a message at Git. Use inline comments.
> While the guidelines talked about keeping the changes small, which is valid.
> But, that file has about four instances of the same "test -f", that is
> not a big change.
> You can change all of those instances.
>
> The main idea of Microproject is to get you familiar with the Git workflow.
> > >
> > > Seems like a good change, but there are lots of these calls in the
> > > codebase. Maybe change the others ones too, while you're at it?
> Valid.
> > >
> > >
> > > Harald
> Thanks at Harald for the review.
>
> Thanks.
>
> Usman.


```

## Srujith A Poojary via GitGitGadget, 2026-10-18 05:05

Subject: [PATCH v3] [Outreachy PATCH] t2030: modernize test path checks
Message-ID: <pull.2256.v3.git.1792299943380.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.2256.v3.git.1792299943380.gitgitgadget%40gmail.com
In-Reply-To: <pull.2256.git.1791978767497.gitgitgadget@gmail.com>

```
From: Srujith Poojary <poojarysrujith@gmail.com>

Replace old-style file checks with test_path_is_file and the helper

test_path_is_missing for clearer failure diagnostics in test output.

Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>
---
    t2030: modernize test path checks

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2256%2Fpoojarysrujith%2Fmicroproject-modernize-path-check-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2256/poojarysrujith/microproject-modernize-path-check-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/2256

Range-diff vs v2:

 1:  93cf6c12f4 ! 1:  75086e1db0 [Outreachy PATCH] t2030: modernize test path checks
     @@ Commit message
      
          test_path_is_missing for clearer failure diagnostics in test output.
      
     -    Search with: git grep "test -[efd]" t/
     -
          Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>
      
       ## t/t2030-unresolve-info.sh ##
     @@ t/t2030-unresolve-info.sh: test_expect_success 'rerere and rerere forget' '
       	tr "\0" "\n" <.git/MERGE_RR >actual &&
       	echo "$rerere_id	fi/le" >expect &&
       	test_cmp expect actual
     +@@ t/t2030-unresolve-info.sh: test_expect_success 'rerere and rerere forget (subdirectory)' '
     + 	(cd fi && git rerere) &&
     + 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
     + 	rerere_id=${rerere_id%/postimage} &&
     +-	test -f .git/rr-cache/$rerere_id/postimage &&
     ++	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
     + 	(cd fi && git checkout -m le) &&
     + 	echo resurrect the conflict &&
     + 	test_grep "^=======" fi/le &&
     +@@ t/t2030-unresolve-info.sh: test_expect_success 'rerere and rerere forget (subdirectory)' '
     + 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
     + 	test -z "$(git ls-files -u)" &&
     + 	(cd fi && git rerere forget le) &&
     +-	! test -f .git/rr-cache/$rerere_id/postimage &&
     ++	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
     + 	tr "\0" "\n" <.git/MERGE_RR >actual &&
     + 	echo "$rerere_id	fi/le" >expect &&
     + 	test_cmp expect actual


 t/t2030-unresolve-info.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 9af24b1204..f6f5dd7cb8 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -170,7 +170,7 @@ test_expect_success 'rerere and rerere forget' '
 	git rerere &&
 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
 	rerere_id=${rerere_id%/postimage} &&
-	test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
 	git checkout -m fi/le &&
 	echo resurrect the conflict &&
 	test_grep "^=======" fi/le &&
@@ -182,7 +182,7 @@ test_expect_success 'rerere and rerere forget' '
 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
 	test -z "$(git ls-files -u)" &&
 	git rerere forget fi/le &&
-	! test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
 	tr "\0" "\n" <.git/MERGE_RR >actual &&
 	echo "$rerere_id	fi/le" >expect &&
 	test_cmp expect actual
@@ -196,7 +196,7 @@ test_expect_success 'rerere and rerere forget (subdirectory)' '
 	(cd fi && git rerere) &&
 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
 	rerere_id=${rerere_id%/postimage} &&
-	test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
 	(cd fi && git checkout -m le) &&
 	echo resurrect the conflict &&
 	test_grep "^=======" fi/le &&
@@ -208,7 +208,7 @@ test_expect_success 'rerere and rerere forget (subdirectory)' '
 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
 	test -z "$(git ls-files -u)" &&
 	(cd fi && git rerere forget le) &&
-	! test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
 	tr "\0" "\n" <.git/MERGE_RR >actual &&
 	echo "$rerere_id	fi/le" >expect &&
 	test_cmp expect actual

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
-- 
gitgitgadget


```
