From patchwork Mon Dec 16 15:47:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Blain via GitGitGadget X-Patchwork-Id: 11294477 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 434F0138C for ; Mon, 16 Dec 2019 15:48:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F4AD206E0 for ; Mon, 16 Dec 2019 15:48:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Gjh7UYYZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728512AbfLPPsO (ORCPT ); Mon, 16 Dec 2019 10:48:14 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50556 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728492AbfLPPsM (ORCPT ); Mon, 16 Dec 2019 10:48:12 -0500 Received: by mail-wm1-f67.google.com with SMTP id a5so7269191wmb.0 for ; Mon, 16 Dec 2019 07:48:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=DQ2eGuP+iM2s02E2HkXytysJUPRhIcOh0Uk/p0Rz6co=; b=Gjh7UYYZz1wlzipp9giy6n4OYVCaUXgvMhOpA6alRggN83bcMWKP0b4MF/nQcryVnA dPI9EUP1WHr+XtKLZEiN+DWm4qyQ2jirawB3HmMjHASZM3q1ja8MyDucDCTlhbT2YmSU 3t1PUQRJMGhAcmAWS427WRwL3KymWLvz1jHPar1DwaEXTGR8jlxBG8ze6aBdnPDORvw2 cfyTsZI1ttDJJL/7Dyb4PWlzohICs+myuT4vK81dGKNQzYq+S9c4leJ1ayVXpE5DFXOL qPAo302MHqOWJmvQtXR0Uw9nF43c5yLjShiMA2bvKo9AF3zzfhYt/Eiv6Qrd1iBdP7/C si1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=DQ2eGuP+iM2s02E2HkXytysJUPRhIcOh0Uk/p0Rz6co=; b=jzW3e0zyexKopCLtDyY8qphugJD9LgFreSCYxMdWej1Nbejo/wrFXROkY867QQue7d 6FkxARab+5zVrgNb1QAyxPJ8WrRta9A3m8K+WXw9FpFEfWmow/9zlXIhEinfQWFHxdFc Q4G6PMeyO8bnQVLZ4r+sJLY2EkEUr8ZZVuKBgD5UWI8/El1L5IWMZm92myNYnOQ1DSXh OWd+9PrunYHnlxzMNzGlWFqbkR//vSziNE6Y+CO3k+Y+BttO9KdjSFbf8L5paGC2jImU djiL7qmyOTND8W1fDEVslSrVC2H1YXt7KsH7UHRBZIWIpsokKEYZuulGw04qFWZhgyY0 SBqA== X-Gm-Message-State: APjAAAUMuc0CHyQvvAUrGQta1Hx+y5ybGcSdZNqKlMO4bjEfYhC2Qf4w rlKiAfhsV8/9J/rdZfn/T54AGcU8 X-Google-Smtp-Source: APXvYqxSO4a4KBbZ43uBrtGW4dKmRLmAHKMNXaOtrq9/DasSekJC2lusD7dKP3C5N77FvAPNYMA3kA== X-Received: by 2002:a1c:a406:: with SMTP id n6mr25646126wme.40.1576511290237; Mon, 16 Dec 2019 07:48:10 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id b16sm22497233wrj.23.2019.12.16.07.48.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2019 07:48:09 -0800 (PST) Message-Id: In-Reply-To: References: From: "Alexandr Miloslavskiy via GitGitGadget" Date: Mon, 16 Dec 2019 15:47:51 +0000 Subject: [PATCH v2 03/18] t7107: add tests for error conditions Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Phillip Wood , Junio C Hamano , Emily Shaffer , Derrick Stolee , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Alexandr Miloslavskiy , Junio C Hamano , Alexandr Miloslavskiy Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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..da833925a6 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 "\-\-pathspec-from-file is incompatible with \-\-patch" err && + + test_must_fail git reset --pathspec-from-file=- -- fileA.t err && + test_i18ngrep "\-\-pathspec-from-file is incompatible with pathspec arguments" err && + + test_must_fail git reset --pathspec-file-nul 2>err && + test_i18ngrep "\-\-pathspec-file-nul requires \-\-pathspec-from-file" err +' + test_done