# [PATCH] t1410: check files and missing paths after reflog rewind

3 messages from 2026-01-11 to 2026-01-11. Participants: Pushkar Singh, Junio C Hamano.
Thread: https://gitlist.dev/t/64770

## Pushkar Singh, 2026-01-11 14:03

Subject: [PATCH] t1410: check files and missing paths after reflog rewind
Message-ID: <20260111140417.36274-1-pushkarkumarsingh1970@gmail.com>
URL: https://gitlist.dev/e/20260111140417.36274-1-pushkarkumarsingh1970%40gmail.com

```
Replace raw `test -f` and `! test -f` checks in the rewind test with
`test_path_is_file` and `test_path_is_missing`. This provides clearer
failure diagnostics and keeps the test consistent with the rest of
the test suite.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>
---
 t/t1410-reflog.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index e30f87a358..ce71f9a30a 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -130,10 +130,10 @@ test_expect_success 'pass through -- to sub-command' '
 
 test_expect_success rewind '
 	test_tick && git reset --hard HEAD~2 &&
-	test -f C &&
-	test -f A/B/E &&
-	! test -f F &&
-	! test -f A/G &&
+	test_path_is_file C &&
+	test_path_is_file A/B/E &&
+	test_path_is_missing F &&
+	test_path_is_missing A/G &&
 
 	check_have A B C D E F G H I J K L &&
 
-- 
2.43.0


```

## Junio C Hamano, 2026-01-11 18:41

Subject: Re: [PATCH] t1410: check files and missing paths after reflog rewind
Message-ID: <xmqqh5ssouub.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqh5ssouub.fsf%40gitster.g
In-Reply-To: <20260111140417.36274-1-pushkarkumarsingh1970@gmail.com>

```
Pushkar Singh <pushkarkumarsingh1970@gmail.com> writes:

> Subject: [PATCH] t1410: check files and missing paths after reflog rewind

That sounds as if the original did not check these things after
"reflog rewind" and this patch is about correcting it, doesn't it?

That is a bit different from what is really happening in this patch.

> Replace raw `test -f` and `! test -f` checks in the rewind test with
> `test_path_is_file` and `test_path_is_missing`. This provides clearer
> failure diagnostics and keeps the test consistent with the rest of
> the test suite.

On the other hand, this describes what the patch does nicely.


```

## Pushkar Singh, 2026-01-11 19:07

Subject: [PATCH v2] t1410: use test helpers in reflog rewind test
Message-ID: <20260111191525.17087-1-pushkarkumarsingh1970@gmail.com>
URL: https://gitlist.dev/e/20260111191525.17087-1-pushkarkumarsingh1970%40gmail.com
In-Reply-To: <xmqqh5ssouub.fsf@gitster.g>

```
Replace raw `test -f` and `! test -f` checks in the rewind test with
`test_path_is_file` and `test_path_is_missing`. This provides clearer
failure diagnostics and keeps the test consistent with the rest of
the test suite.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>
---
 t/t1410-reflog.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index e30f87a358..ce71f9a30a 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -130,10 +130,10 @@ test_expect_success 'pass through -- to sub-command' '
 
 test_expect_success rewind '
 	test_tick && git reset --hard HEAD~2 &&
-	test -f C &&
-	test -f A/B/E &&
-	! test -f F &&
-	! test -f A/G &&
+	test_path_is_file C &&
+	test_path_is_file A/B/E &&
+	test_path_is_missing F &&
+	test_path_is_missing A/G &&
 
 	check_have A B C D E F G H I J K L &&
 
-- 
2.43.0


```
