git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/3] t4117: check for files using `test_path_is_file`
@ 2020-02-23  8:48 Martin Ågren
  2020-02-23  8:48 ` [PATCH 2/3] t9810: drop debug `cat` call Martin Ågren
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Martin Ågren @ 2020-02-23  8:48 UTC (permalink / raw)
  To: git

We `cat` files, but don't inspect or grab the contents in any way. These
`cat` calls look like remnants from a debug session, so it's tempting to
get rid of them. But they do actually verify that the files exist, which
might not necessarily be the case for some failure modes of `git apply
--reject`. Let's not lose that.

Convert the `cat` calls to use `test_path_is_file` instead. This is of
course still a minor change since we no longer verify that the files can
be opened for reading, but that is not something we usually worry about.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 t/t4117-apply-reject.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t4117-apply-reject.sh b/t/t4117-apply-reject.sh
index f7de6f077a..0ee93fe845 100755
--- a/t/t4117-apply-reject.sh
+++ b/t/t4117-apply-reject.sh
@@ -74,7 +74,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
 	test_must_fail git apply --reject patch.1 &&
 	test_cmp expected file1 &&
 
-	cat file1.rej &&
+	test_path_is_file file1.rej &&
 	test_path_is_missing file2.rej
 '
 
@@ -87,7 +87,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
 	test_path_is_missing file1 &&
 	test_cmp expected file2 &&
 
-	cat file2.rej &&
+	test_path_is_file file2.rej &&
 	test_path_is_missing file1.rej
 
 '
@@ -101,7 +101,7 @@ test_expect_success 'the same test with --verbose' '
 	test_path_is_missing file1 &&
 	test_cmp expected file2 &&
 
-	cat file2.rej &&
+	test_path_is_file file2.rej &&
 	test_path_is_missing file1.rej
 
 '
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-24 20:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-23  8:48 [PATCH 1/3] t4117: check for files using `test_path_is_file` Martin Ågren
2020-02-23  8:48 ` [PATCH 2/3] t9810: drop debug `cat` call Martin Ågren
2020-02-24 19:18   ` Junio C Hamano
2020-02-23  8:48 ` [PATCH 3/3] t: drop debug `cat` calls Martin Ågren
2020-02-24 19:32   ` Junio C Hamano
2020-02-24 20:24     ` Martin Ågren
2020-02-24 20:49       ` Junio C Hamano
2020-02-23 21:46 ` [PATCH 1/3] t4117: check for files using `test_path_is_file` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).