[PATCH v2 3/7] t/t1517: move ls-files -h test to t1517
- From
Usman Akinyemi <usmanakinyemi202@gmail.com>
- Date
- Jul 6, 2025, 21:41 UTC
- Message-ID
- <20250706214108.714499-4-usmanakinyemi202@gmail.com>
- In-Reply-To
- <20250706214108.714499-1-usmanakinyemi202@gmail.com>
The test 'ls-files 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 "t3004-ls-files-basic.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/t3004-ls-files-basic.sh | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh index 92ad159b58..e04be2d811 100755 --- a/t/t1517-outside-repo.sh +++ b/t/t1517-outside-repo.sh @@ -128,4 +128,11 @@ test_expect_success 'for-each-ref does not crash with -h' ' test_grep "[Uu]sage: git for-each-ref " usage ' +test_expect_success 'ls-files does not crash with -h' ' + test_expect_code 129 git ls-files -h >usage && + test_grep "[Uu]sage: git ls-files " usage && + test_expect_code 129 nongit git ls-files -h >usage && + test_grep "[Uu]sage: git ls-files " usage +' + test_done diff --git a/t/t3004-ls-files-basic.sh b/t/t3004-ls-files-basic.sh index 4034a5a59f..a1078f8701 100755 --- a/t/t3004-ls-files-basic.sh +++ b/t/t3004-ls-files-basic.sh @@ -34,13 +34,6 @@ test_expect_success 'ls-files -h in corrupt repository' ' test_grep "[Uu]sage: git ls-files " broken/usage ' -test_expect_success 'ls-files does not crash with -h' ' - test_expect_code 129 git ls-files -h >usage && - test_grep "[Uu]sage: git ls-files " usage && - test_expect_code 129 nongit git ls-files -h >usage && - test_grep "[Uu]sage: git ls-files " usage -' - test_expect_success SYMLINKS 'ls-files with absolute paths to symlinks' ' mkdir subs && ln -s nosuch link &&
-- 2.50.0