From: Alexandr Miloslavskiy via GitGitGadget Date: Thu, 19 Dec 2019 18:01:40 GMT Subject: [PATCH v3 03/18] t7107: add tests for error conditions Message-ID: In-Reply-To: From: Alexandr Miloslavskiy Suggested-By: Phillip Wood Signed-off-by: Alexandr Miloslavskiy --- t/t7107-reset-pathspec-file.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh index f36fce27b9..e91b0ff62d 100755 --- a/t/t7107-reset-pathspec-file.sh +++ b/t/t7107-reset-pathspec-file.sh @@ -74,4 +74,18 @@ test_expect_success '--pathspec-from-file is not compatible with --soft or --har test_must_fail git reset --hard --pathspec-from-file=list ' +test_expect_success 'error conditions' ' + restore_checkpoint && + echo fileA.t >list && + + test_must_fail git reset --pathspec-from-file=- --patch err && + test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err && + + test_must_fail git reset --pathspec-from-file=- -- fileA.t 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_done -- gitgitgadget