diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-01-31 01:17:08 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-31 01:17:08 +0300 |
commit | 96aef8f68404964c48d0d85ce04f6b2d84097246 (patch) | |
tree | 91c0f4bac02e2932ce5166586359c6b074a16b44 /t/t7107-reset-pathspec-file.sh | |
parent | d52adee7790352c96fa37558206e6db8866879d2 (diff) | |
parent | f94f7bd00d06c6b651a0e7afcc90ac86cc5f391b (diff) |
Merge branch 'am/test-pathspec-f-f-error-cases'
More tests.
* am/test-pathspec-f-f-error-cases:
t: add tests for error conditions with --pathspec-from-file
Diffstat (limited to 't/t7107-reset-pathspec-file.sh')
-rwxr-xr-x | t/t7107-reset-pathspec-file.sh | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh index b0e84cdb42..cad3a9de9e 100755 --- a/t/t7107-reset-pathspec-file.sh +++ b/t/t7107-reset-pathspec-file.sh @@ -134,15 +134,6 @@ test_expect_success 'quotes not compatible with --pathspec-file-nul' ' test_must_fail verify_expect ' -test_expect_success '--pathspec-from-file is not compatible with --soft or --hard' ' - restore_checkpoint && - - git rm fileA.t && - echo fileA.t >list && - test_must_fail git reset --soft --pathspec-from-file=list && - test_must_fail git reset --hard --pathspec-from-file=list -' - test_expect_success 'only touches what was listed' ' restore_checkpoint && @@ -158,4 +149,25 @@ test_expect_success 'only touches what was listed' ' verify_expect ' +test_expect_success 'error conditions' ' + restore_checkpoint && + echo fileA.t >list && + git rm fileA.t && + + test_must_fail git reset --pathspec-from-file=list --patch 2>err && + test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err && + + test_must_fail git reset --pathspec-from-file=list -- fileA.t 2>err && + test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && + + test_must_fail git reset --pathspec-file-nul 2>err && + test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && + + test_must_fail git reset --soft --pathspec-from-file=list 2>err && + test_i18ngrep -e "fatal: Cannot do soft reset with paths" err && + + test_must_fail git reset --hard --pathspec-from-file=list 2>err && + test_i18ngrep -e "fatal: Cannot do hard reset with paths" err +' + test_done |