From patchwork Wed Dec 4 07:47:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11272221 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 2453D6C1 for ; Wed, 4 Dec 2019 07:48:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0123420637 for ; Wed, 4 Dec 2019 07:48:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AIBOgq2l" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727119AbfLDHr7 (ORCPT ); Wed, 4 Dec 2019 02:47:59 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:38780 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726048AbfLDHr7 (ORCPT ); Wed, 4 Dec 2019 02:47:59 -0500 Received: by mail-pl1-f196.google.com with SMTP id o8so2817505pls.5 for ; Tue, 03 Dec 2019 23:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mcvSIFKED6eEr6cLl9VnEAcgMfrYd6ySclhfRxTwBA4=; b=AIBOgq2lBrPYsrDTtTaiEQrfhLciwYSb+XNUIpi3tLcAIB70xVTWTxrzl2sHbCRX3u yXz0YXlnKUFoHdycv46fRlzZZXmPx/HmvrnMbR8cwYFCE33wT9cnbiFvT0RoDR+Jigfr dMfyjMUI9T+beEpj1TZKH1a2maQ+x1iMPACG5mykttvz+lBOpX5JxHTJ+CRInnLzp32o 1ngRyushz5dENHW3bQZCI6I7/VVeLj3jrrieqpA5s9hQGt4prUYq7XHSUvZKjRIMiFHW 4B2j//B7v671oLEYyctrJ3SDDdGMw7gic/vDeOp3a8RAy0GGOSJXhoIObphrhmpPYNp8 NObQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mcvSIFKED6eEr6cLl9VnEAcgMfrYd6ySclhfRxTwBA4=; b=ed8ybOujRkInUDYd9iOL0FfrziWUgV9nR8su8stSSPbAyDasbkS8uvJ6kDYvbuKYBf y+N8bES0mMsIaXI0rBORbRSDQ6t4KqpJM8Q0UPsZwF96wG+0TCehRVly8yVgdcLFrqTI 7ob9d4VOq5m954DN6rbn/+AYZhWhZth59NL+LZGcwj7ESiVrF8QNZ2wxlfnDrn3ws/5N aEJwKW9YcKUVwDVxIJVXDHD/kR3BDvoxoA0JGW17pRw97syqOrm4c3tEiENwr3XihVRW rJ5/qLF8dADWeCPIBs7YqKCjmhVmnpr/OQy2/83otxbvuQnYAjdT1GjnDETd1N8o/owh 8j3g== X-Gm-Message-State: APjAAAXOwxiCd2ibqGzKyl/v56JDGiMBLa7LEXW/gdsek7SuxreC7lBr MHVWRrqbqiHEPZNGkYc8mo2dTfZF X-Google-Smtp-Source: APXvYqyyBU1jlUUkilpujWkSpWFcu9h2svVy5kFeasCnd84aZG65XO7SFkuHL89x/Fcpej4AeBKHmg== X-Received: by 2002:a17:902:7c0c:: with SMTP id x12mr2121288pll.239.1575445678592; Tue, 03 Dec 2019 23:47:58 -0800 (PST) Received: from generichostname ([2601:646:280:1b30:b0bc:639f:d5c8:2bcf]) by smtp.gmail.com with ESMTPSA id y144sm7240937pfb.188.2019.12.03.23.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2019 23:47:58 -0800 (PST) Date: Tue, 3 Dec 2019 23:47:56 -0800 From: Denton Liu To: Git Mailing List Cc: Christian Biesinger , Eric Sunshine , Junio C Hamano Subject: [PATCH v3 3/5] t4014: use test_config() Message-ID: <638c4add00657daa9b7a4fa50882053335d5caef.1575445583.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Instead of manually unsetting the config after the test case is done, use test_config() to do it automatically. While we're at it, fix a typo in a test case name. Signed-off-by: Denton Liu --- t/t4014-format-patch.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 69267b16f0..c7cc643adf 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1939,10 +1939,9 @@ test_expect_success 'format-patch errors out when history involves criss-cross' test_must_fail git format-patch --base=auto -1 ' -test_expect_success 'format-patch format.useAutoBaseoption' ' - test_when_finished "git config --unset format.useAutoBase" && +test_expect_success 'format-patch format.useAutoBase option' ' git checkout local && - git config format.useAutoBase true && + test_config format.useAutoBase true && git format-patch --stdout -1 >patch && grep "^base-commit:" patch >actual && git rev-parse upstream >commit-id-base && @@ -1951,8 +1950,7 @@ test_expect_success 'format-patch format.useAutoBaseoption' ' ' test_expect_success 'format-patch --base overrides format.useAutoBase' ' - test_when_finished "git config --unset format.useAutoBase" && - git config format.useAutoBase true && + test_config format.useAutoBase true && git format-patch --stdout --base=HEAD~1 -1 >patch && grep "^base-commit:" patch >actual && git rev-parse HEAD~1 >commit-id-base &&