From: Usman Akinyemi <usmanakinyemi202@gmail.com>
To: git@vger.kernel.org
Cc: ps@pks.im, chriscool@tuxfamily.org, christian.couder@gmail.com,
gitster@pobox.com, me@ttaylorr.com, usmanakinyemi202@gmail.com
Subject: [PATCH 2/7] t/t1517: move for-each-ref -h test to t1517
Date: Mon, 7 Jul 2025 02:37:20 +0530 [thread overview]
Message-ID: <20250706210725.79903-3-usmanakinyemi202@gmail.com> (raw)
In-Reply-To: <20250706210725.79903-1-usmanakinyemi202@gmail.com>
The test 'for-each-ref does not crash with -h' checks that
the command exits cleanly with usage information, both inside and
outside of a repository.
Move this test from "t6300-for-each-ref.sh" to
"t1517-outside-repo.sh" since it better fits with tests that check
command behavior outside a repository.
Suggested-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
---
t/t1517-outside-repo.sh | 7 +++++++
t/t6300-for-each-ref.sh | 7 -------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh
index 98a453db58..92ad159b58 100755
--- a/t/t1517-outside-repo.sh
+++ b/t/t1517-outside-repo.sh
@@ -121,4 +121,11 @@ test_expect_success 'checkout-index does not crash with -h' '
test_grep "[Uu]sage: git checkout-index " usage
'
+test_expect_success 'for-each-ref does not crash with -h' '
+ test_expect_code 129 git for-each-ref -h >usage &&
+ test_grep "[Uu]sage: git for-each-ref " usage &&
+ test_expect_code 129 nongit git for-each-ref -h >usage &&
+ test_grep "[Uu]sage: git for-each-ref " usage
+'
+
test_done
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index ce9af79ab1..5db7038c41 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -292,13 +292,6 @@ test_expect_success 'Check invalid atoms names are errors' '
test_must_fail git for-each-ref --format="%(INVALID)" refs/heads
'
-test_expect_success 'for-each-ref does not crash with -h' '
- test_expect_code 129 git for-each-ref -h >usage &&
- test_grep "[Uu]sage: git for-each-ref " usage &&
- test_expect_code 129 nongit git for-each-ref -h >usage &&
- test_grep "[Uu]sage: git for-each-ref " usage
-'
-
test_expect_success 'Check format specifiers are ignored in naming date atoms' '
git for-each-ref --format="%(authordate)" refs/heads &&
git for-each-ref --format="%(authordate:default) %(authordate)" refs/heads &&
--
2.50.0
next prev parent reply other threads:[~2025-07-06 21:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-06 21:07 [PATCH 0/7] move builtin help test to t1517 Usman Akinyemi
2025-07-06 21:07 ` [PATCH 1/7] t/t1517: move checkout-index -h " Usman Akinyemi
2025-07-06 21:07 ` Usman Akinyemi [this message]
2025-07-06 21:07 ` [PATCH 3/7] t/t1517: move ls-files " Usman Akinyemi
2025-07-06 21:07 ` [PATCH 4/7] t/t1517: move pack-refs " Usman Akinyemi
2025-07-06 21:07 ` [PATCH 5/7] t/t1517: move send-pack " Usman Akinyemi
2025-07-06 21:07 ` [PATCH 6/7] t/t1517: move verify-commit " Usman Akinyemi
2025-07-06 21:07 ` [PATCH 7/7] t/t1517: move verify-tag " Usman Akinyemi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250706210725.79903-3-usmanakinyemi202@gmail.com \
--to=usmanakinyemi202@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.com \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).