diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-12-28 01:52:25 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-12-28 01:52:25 +0300 |
commit | 73b1808fa3f9cd7c0a6e5e5079a9715bade5f4a0 (patch) | |
tree | def0d28c9ad6bb9a9d2cfa15ff063f978cc090b9 /t | |
parent | 637e34a783e6c377a111629692fc24449e651efb (diff) | |
parent | 7382497372f065fefe737333980a8146ede2955c (diff) |
Merge branch 'rs/show-ref-incompatible-options'
Code clean-up for sanity checking of command line options for "git
show-ref".
* rs/show-ref-incompatible-options:
show-ref: use die_for_incompatible_opt3()
Diffstat (limited to 't')
-rwxr-xr-x | t/t1403-show-ref.sh | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh index b50ae6fcf1..d477689e33 100755 --- a/t/t1403-show-ref.sh +++ b/t/t1403-show-ref.sh @@ -197,18 +197,20 @@ test_expect_success 'show-ref --verify with dangling ref' ' ' test_expect_success 'show-ref sub-modes are mutually exclusive' ' - cat >expect <<-EOF && - fatal: only one of ${SQ}--exclude-existing${SQ}, ${SQ}--verify${SQ} or ${SQ}--exists${SQ} can be given - EOF - test_must_fail git show-ref --verify --exclude-existing 2>err && - test_cmp expect err && + grep "verify" err && + grep "exclude-existing" err && + grep "cannot be used together" err && test_must_fail git show-ref --verify --exists 2>err && - test_cmp expect err && + grep "verify" err && + grep "exists" err && + grep "cannot be used together" err && test_must_fail git show-ref --exclude-existing --exists 2>err && - test_cmp expect err + grep "exclude-existing" err && + grep "exists" err && + grep "cannot be used together" err ' test_expect_success '--exists with existing reference' ' |