git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t3501: use test_path_is_* functions
@ 2022-03-30 21:43 Labnan via GitGitGadget
  2022-03-30 22:11 ` Ævar Arnfjörð Bjarmason
  2022-04-22 11:26 ` [PATCH v2] " Labnan via GitGitGadget
  0 siblings, 2 replies; 16+ messages in thread
From: Labnan via GitGitGadget @ 2022-03-30 21:43 UTC (permalink / raw)
  To: git; +Cc: Labnan, Labnann

From: Labnann <khalid.masum.92@gmail.com>

Two test -f are present in t3501. They can be replaced with appropriate
helper function: test_path_is_file

Signed-off-by: Labnann <khalid.masum.92@gmail.com>
---
    [GSoC][PATCH] t3501: Use test_path_is_* Functions
    
    Two test -f are present in t3501. They can be replaced with appropriate
    helper function: test_path_is_file. Which makes the script more readable
    and gives better error messages.
    
    Signed-off-by: Labnann khalid.masum.92@gmail.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1195%2FLabnann%2Ft3501-helper-functions-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1195/Labnann/t3501-helper-functions-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1195

 t/t3501-revert-cherry-pick.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 8617efaaf1e..45492a7ed09 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -67,7 +67,7 @@ test_expect_success 'cherry-pick after renaming branch' '
 	git checkout rename2 &&
 	git cherry-pick added &&
 	test $(git rev-parse HEAD^) = $(git rev-parse rename2) &&
-	test -f opos &&
+	test_path_is_file opos &&
 	grep "Add extra line at the end" opos &&
 	git reflog -1 | grep cherry-pick
 
@@ -78,7 +78,7 @@ test_expect_success 'revert after renaming branch' '
 	git checkout rename1 &&
 	git revert added &&
 	test $(git rev-parse HEAD^) = $(git rev-parse rename1) &&
-	test -f spoo &&
+	test_path_is_file spoo &&
 	! grep "Add extra line at the end" spoo &&
 	git reflog -1 | grep revert
 

base-commit: 805e0a68082a217f0112db9ee86a022227a9c81b
-- 
gitgitgadget

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

end of thread, other threads:[~2022-04-22 11:27 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 21:43 [PATCH] t3501: use test_path_is_* functions Labnan via GitGitGadget
2022-03-30 22:11 ` Ævar Arnfjörð Bjarmason
2022-03-31 19:15   ` [PATCH v2 0/3][GSoC] t3501: remove test and test -f Labnann
2022-03-31 19:15     ` [PATCH v2 1/3] t3501: use test_path_is_* functions Labnann
2022-03-31 19:15     ` [PATCH v2 2/3] t3501: don't ignore "git <cmd>" exit code Labnann
2022-04-01 18:10       ` Junio C Hamano
2022-03-31 19:15     ` [PATCH v2 3/3] t3501: test cherry-pick revert with oids Labnann
2022-04-01 18:24       ` Junio C Hamano
2022-04-02 19:24     ` [PATCH v3 0/1][GSoC] t3501: remove redundant file checking and stop ignoring git <cmd> exit code Labnann
2022-04-02 19:24       ` [PATCH v3 1/1] t3501: remove redundant file check " Labnann
2022-04-04 15:54         ` Junio C Hamano
2022-04-05 13:47       ` [PATCH v4 0/1][GSoC] t3501: remove test -f " Khalid Masum
2022-04-05 13:47         ` [PATCH v4 1/1] " Khalid Masum
2022-04-05 15:06       ` [PATCH v4 0/1][GSoC] " Khalid Masum
2022-04-05 15:06         ` [PATCH v4 1/1] " Khalid Masum
2022-04-22 11:26 ` [PATCH v2] " Labnan via GitGitGadget

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).