git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] t5300: modernize test path checks in t5300

From
OTOgundipe Sola Taiwo <ogundipesolataiwo12@gmail.com>
Date
Oct 27, 2026, 18:36 UTC
Message-ID
<20261027183623.3600-1-ogundipesolataiwo12@gmail.com>
In-Reply-To
<20261023154851.7876-1-ogundipesolataiwo12@gmail.com>

Improves test t5300-pack-object by converting old-style path checks to use the `test_path_is_file` helper function.

Signed-off-by: Ogundipe Sola Taiwo <ogundipesolataiwo12@gmail.com>
---
Changes in v2:
- Rephrase patch summary to remove redundant wording
 t/t5300-pack-object.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index aac139e6a0..e5ce478484 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -283,11 +283,11 @@ test_expect_success 'survive missing objects/pack directory' '
 		GOP=.git/objects/pack &&
 		rm -fr $GOP &&
 		git index-pack --stdin --keep=test <../test-3-${packname_3}.pack &&
-		test -f $GOP/pack-${packname_3}.pack &&
+		test_path_is_file $GOP/pack-${packname_3}.pack &&
 		cmp $GOP/pack-${packname_3}.pack ../test-3-${packname_3}.pack &&
-		test -f $GOP/pack-${packname_3}.idx &&
+		test_path_is_file $GOP/pack-${packname_3}.idx &&
 		cmp $GOP/pack-${packname_3}.idx ../test-3-${packname_3}.idx &&
-		test -f $GOP/pack-${packname_3}.keep
+		test_path_is_file $GOP/pack-${packname_3}.keep
 	)
 '

@@ -376,7 +376,7 @@ test_expect_success 'build pack index for an existing pack' '
 	rm -f test-4.keep &&
 	git index-pack --keep=why test-4.pack &&
 	cmp test-1-${packname_1}.idx test-4.idx &&
-	test -f test-4.keep &&
+	test_path_is_file test-4.keep &&

 	:
 '
@@ -616,7 +616,7 @@ test_expect_success 'setup: fake a SHA1 hash collision' '
 		cd corrupt &&
 		long_a=$(git hash-object -w ../a | sed -e "s!^..!&/!") &&
 		long_b=$(git hash-object -w ../b | sed -e "s!^..!&/!") &&
-		test -f	.git/objects/$long_b &&
+		test_path_is_file .git/objects/$long_b &&
 		cp -f	.git/objects/$long_a \
 			.git/objects/$long_b
 	)

Range-diff against v1:
1:  ca6cd5870e = 1:  ca6cd5870e t5300: modernize test path checks in t5300
--
2.56.0.116.g6de20f6092.dirty
Previous: Usman AkinyemiNext: Usman Akinyemi
Message 5 of 11 in “[Outreachy] Microproject: Modernize file check in t5300-pack-object.sh”
  1. Ogundipe Sola TaiwoOct 23, 2026
  2. t5300: modernize test path checks in t5300Ogundipe Sola Taiwo, Oct 26, 2026
  3. Usman AkinyemiOct 27, 2026
  4. Usman AkinyemiOct 26, 2026
  5. t5300: modernize test path checks in t5300Ogundipe Sola Taiwo, Oct 27, 2026
  6. Usman AkinyemiOct 28, 2026
  7. Junio C HamanoOct 28, 2026
  8. Ogundipe Sola TaiwoOct 27, 2026
  9. Ogundipe Sola TaiwoOct 29, 2026
  10. t5300: modernize test path checks in t5300Ogundipe Sola Taiwo, Oct 29, 2026
  11. Junio C HamanoOct 29, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.