Skip to content

Commit 91de82a

Browse files
Martin Ågrengitster
authored andcommitted
t4117: check for files using test_path_is_file
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d0654dc commit 91de82a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t4117-apply-reject.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
7474
test_must_fail git apply --reject patch.1 &&
7575
test_cmp expected file1 &&
7676
77-
cat file1.rej &&
77+
test_path_is_file file1.rej &&
7878
test_path_is_missing file2.rej
7979
'
8080

@@ -87,7 +87,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
8787
test_path_is_missing file1 &&
8888
test_cmp expected file2 &&
8989
90-
cat file2.rej &&
90+
test_path_is_file file2.rej &&
9191
test_path_is_missing file1.rej
9292
9393
'
@@ -101,7 +101,7 @@ test_expect_success 'the same test with --verbose' '
101101
test_path_is_missing file1 &&
102102
test_cmp expected file2 &&
103103
104-
cat file2.rej &&
104+
test_path_is_file file2.rej &&
105105
test_path_is_missing file1.rej
106106
107107
'

0 commit comments

Comments
 (0)