From patchwork Sun Jan 3 09:36:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_=C3=85gren?= X-Patchwork-Id: 11995581 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08EA8C433E0 for ; Sun, 3 Jan 2021 09:38:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8FD1207FB for ; Sun, 3 Jan 2021 09:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726434AbhACJi3 (ORCPT ); Sun, 3 Jan 2021 04:38:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbhACJi2 (ORCPT ); Sun, 3 Jan 2021 04:38:28 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1FCFC0613C1 for ; Sun, 3 Jan 2021 01:37:47 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id h22so57786814lfu.2 for ; Sun, 03 Jan 2021 01:37:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k9pvG6dgK0fq9U4gx4tC1Z2QmcZb9g16si1bTJM5aG8=; b=uHHv8S4+c6inmo1PXpiMmy4SGSft9WDFMPFga3R7a/y9RmMkenTr3JUYN8q0D0BH9F PXSRfSIcsL+TwnfnX4056T/ftec81mA/zSId4ZbPbbXczQIh4pMMal8dT8lECeZJNCsz AELy7mnUaPuXTrs+d25WmqIFM2H1uliMhSWrzQj7VJCZ1XLyfRCc9/fY8hqf8j48Tfbw EwhMaRgUaXu8NQtph0nVQweBLKJ435BGJ2yDwvHablnTPT+8FIP0u2NJnbEXeUytzSVD 26NV8FT7/3B+HBUzq/NIOSK8T3TTu6ncifCNati0MXia3+9OgRIjpKCb0QcbkkPm7e1W lnzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k9pvG6dgK0fq9U4gx4tC1Z2QmcZb9g16si1bTJM5aG8=; b=kYxrJQq1GEPHoaWqcggGih8OlXXpq5MLe0tFd48xJkX0wDYURKNfmN+J9xTp1AMZUe A96FXc8yBKECl3eoFt/yPdp2INFIkpXM3R097p6Y5yMI9mGABEUwPuLnMIir9J4CNUOl RCRuSkLVYcaXvgKLcP5Fvm5IwaiPQfk3QezcilLdb/eIcsCD/hZd3nQ5GNaQghr1/Mv6 XjkBCib2oCdCTpzKM6jEdappM+d5Eu+hSJVaJm0SZV6Y+duevrgnhqhTHJfRMlxma5ca q2+fAuesWliGD+XWcqv++69mA1i2Vj6Yjsgzh5y4RDM3EgzjNuJVs+14vQdkn+5Nc/AM G5QA== X-Gm-Message-State: AOAM5300kpPvhLE49YLI3XqT2Q1Zsy66WhirOylmUL27DELoy68VTqx4 lBmBhgt/vFYv/4tbvhIq9uvE4xr8cV4= X-Google-Smtp-Source: ABdhPJxO7Za1Ci9dBfdK+Np47VVpHKLAZPMvZhnc/lML0qDtriS8GbcGE1SG+Y/b7q4NWkb9BSbFeA== X-Received: by 2002:ac2:598f:: with SMTP id w15mr27557680lfn.577.1609666666242; Sun, 03 Jan 2021 01:37:46 -0800 (PST) Received: from localhost.localdomain (host-189-203-5.junet.se. [207.189.203.5]) by smtp.gmail.com with ESMTPSA id h13sm7025202lfj.110.2021.01.03.01.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jan 2021 01:37:45 -0800 (PST) From: =?utf-8?q?Martin_=C3=85gren?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King Subject: [PATCH 1/3] t1300: remove duplicate test for `--file ../foo` Date: Sun, 3 Jan 2021 10:36:46 +0100 Message-Id: <20210103093649.2221-2-martin.agren@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210103093649.2221-1-martin.agren@gmail.com> References: <20210103093649.2221-1-martin.agren@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We have two tests for checking that we can handle `git config --file ../other-config ...`. One, using `--file`, was introduced in 65807ee697 ("builtin-config: Fix crash when using "-f " from non-root dir", 2010-01-26), then another, using `GIT_CONFIG`, came about in 270a34438b ("config: stop using config_exclusive_filename", 2012-02-16). The latter of these was then converted to use `--file` in f7e8714101 ("t: prefer "git config --file" to GIT_CONFIG", 2014-03-20). Both where then simplified in a5db0b77b9 ("t1300: extract and use test_cmp_config()", 2018-10-21). These two tests differ slightly in the order of the options used, but other than that, they are identical. Let's drop one. As noted in f7e8714101, we do still have a test for `GIT_CONFIG` and it shares the implementation with `--file`. Signed-off-by: Martin Ågren --- t/t1300-config.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 97a04c6cc2..302821fb02 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -506,10 +506,6 @@ test_expect_success 'editing stdin is an error' ' test_expect_success 'refer config from subdirectory' ' mkdir x && - test_cmp_config -C x strasse --get --file ../other-config ein.bahn -' - -test_expect_success 'refer config from subdirectory via --file' ' test_cmp_config -C x strasse --file=../other-config --get ein.bahn ' From patchwork Sun Jan 3 09:36:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_=C3=85gren?= X-Patchwork-Id: 11995583 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21399C433E6 for ; Sun, 3 Jan 2021 09:38:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E17F220829 for ; Sun, 3 Jan 2021 09:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726487AbhACJih (ORCPT ); Sun, 3 Jan 2021 04:38:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbhACJig (ORCPT ); Sun, 3 Jan 2021 04:38:36 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2536C0613CF for ; Sun, 3 Jan 2021 01:37:55 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id y19so57531672lfa.13 for ; Sun, 03 Jan 2021 01:37:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XClaAPDqPKJ2pjsDU3Q20hVdUOKIsnRj6sZJs89IMJk=; b=BWUVu7qrnrpuIsmD4+tGqyT/8RBlDXYAgM1jy7UuJCt6iBJzrC7owF6FNoXoRsFCXB J+/g3bazd4Dg2ZBXojl5sSzLktu35fC3wPCnMXZOcEx4KTGQzLqB2edZC4ND/eLB7c0y z2Jr3nupw9CXHbV5z10D/pKbmAe8yfcDX0O8392P9ZE1rQOk55FY5kBoYboXEGoz/TOM rAsglswan3ja2MJ+CxcoN8HhKxUeFX3Wk6MFcxFeNYXKZ6uvhhqgtWtWqPCMCZk79pen 3X+cs280zwQqvLztHgWoGGTEylNTI/90VpfIdEpx+swYZRmEjS5c7opwvh/R5MaKE91E Ym9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XClaAPDqPKJ2pjsDU3Q20hVdUOKIsnRj6sZJs89IMJk=; b=PCcHhyVhLmodXrrkFjVtleoAyoDaVK65vco9/M7Ef2bOG7UkK6Sf33ygcYqTjoDm0O cF/pqPrYRePsv0bZPfzy7UrqNlSng8gXvbWLgK7eqykpybnh0TmLkVrB83E8jvrJIIAx gpfQ36Y4iUqLogAFEqmsjO60f1MrQFjypQv3u4MvyOBGZvTN45CduLUFfwmhu+PLG8YC bmV0K3yH7BucnYNH2ndiOMzvVHooli+dqTgemoRLlRtS8qQKe0k8/PO1YQaBN9HNLhk6 OBegpjbtN6wQFISSD7BIRS1WDDK/WjQLzMoq4lF5Go66+G2Zlltxging0j7oXTuMujiC BGrw== X-Gm-Message-State: AOAM531hLvrcg1ga/feqsgmGCIU7LMb30q2hdBWflsyd2Da0yBoxFuj0 /Pyero1IZwl0Tf4WD8JFPmm6YeC+yg0= X-Google-Smtp-Source: ABdhPJyftoMrm4kwiAIO1vw9i6/UGwc2641nUoUmOlwfi3zK8/z3GMECPwmHDs0q31/Q0bspA4mc/A== X-Received: by 2002:ac2:5333:: with SMTP id f19mr32129928lfh.344.1609666674118; Sun, 03 Jan 2021 01:37:54 -0800 (PST) Received: from localhost.localdomain (host-189-203-5.junet.se. [207.189.203.5]) by smtp.gmail.com with ESMTPSA id h13sm7025202lfj.110.2021.01.03.01.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jan 2021 01:37:53 -0800 (PST) From: =?utf-8?q?Martin_=C3=85gren?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King Subject: [PATCH 2/3] t1300: remove duplicate test for `--file no-such-file` Date: Sun, 3 Jan 2021 10:36:47 +0100 Message-Id: <20210103093649.2221-3-martin.agren@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210103093649.2221-1-martin.agren@gmail.com> References: <20210103093649.2221-1-martin.agren@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We test that we can handle `git config --file symlink` and the error case of `git config --file symlink-to-missing-file`. For good measure, we also throw in a test to check that we correctly handle referencing a missing regular file. But we have such a test earlier in this script. They both check that we fail to use `--file no-such-file --list`. Drop the latter of these and keep the one that is in the general area where we test `--file` and `GIT_CONFIG`. The one we're dropping also checks that we can't even get a specific key from the missing file -- let's make sure we check that in the test we keep. Signed-off-by: Martin Ågren --- t/t1300-config.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 302821fb02..1439d870d6 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -469,7 +469,8 @@ test_expect_success 'new variable inserts into proper section' ' ' test_expect_success 'alternative --file (non-existing file should fail)' ' - test_must_fail git config --file non-existing-config -l + test_must_fail git config --file non-existing-config -l && + test_must_fail git config --file non-existing-config test.xyzzy ' cat > other-config << EOF @@ -1032,11 +1033,6 @@ test_expect_success SYMLINKS 'symlinked configuration' ' test_cmp expect actual ' -test_expect_success 'nonexistent configuration' ' - test_must_fail git config --file=doesnotexist --list && - test_must_fail git config --file=doesnotexist test.xyzzy -' - test_expect_success SYMLINKS 'symlink to nonexistent configuration' ' ln -s doesnotexist linktonada && ln -s linktonada linktolinktonada && From patchwork Sun Jan 3 09:36:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_=C3=85gren?= X-Patchwork-Id: 11995585 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4473C433E0 for ; Sun, 3 Jan 2021 09:39:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7EF4C207D0 for ; Sun, 3 Jan 2021 09:39:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726502AbhACJio (ORCPT ); Sun, 3 Jan 2021 04:38:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbhACJin (ORCPT ); Sun, 3 Jan 2021 04:38:43 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA317C0613D3 for ; Sun, 3 Jan 2021 01:38:02 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id 23so57647794lfg.10 for ; Sun, 03 Jan 2021 01:38:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XTsPTBuSCgGq6w0FtryVXQm3qWN5d7A8LdtMbVglqxM=; b=WpFVz/N8YBGOravPMYf0ynL9W7zV6R1yMvKjIDGXnQMNROztL+LyZhjkBBWaa11KXK obtn399Rj+8X81/xFYwJ9wNkBdIpLOtgm+GTvCE1Jo7EYBvxWJ3rluK9RoapgUOGKknO AU9zUSLTc9bcancj0J9iTy4W0Iw18UtMBGX71drAi1uHFo8CRDt/9BcFJmgGSAlEME2E a0UswGvbkZeSvDUvYZU0+crQyBDf5rNxiEV/nSyrBT4rZfrNWgIH+ucNUg7q1vJsvqcB ZmfNXFe2a5fLMAfvWNqDPxIcVHPsVS0ZcXPNULPXviCjH4pZHmXJl4d6C0bNzmjfbrYk XoVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XTsPTBuSCgGq6w0FtryVXQm3qWN5d7A8LdtMbVglqxM=; b=lQUPVwBIg5QRHFs3Fsjgl0YB13JgnCVmoUqAe2tITZJx/3iIpL+1Yybb9pd560NhGS 9XeXVET4lVcibluEfm5WxAzzYvCaK9rSh/tFBtRPjN9bW5R+X0b3pGoLIoiDOPv0fQLg tz50h6wgKxxFhQdCeS57wE6Aw0UHonnr2vkG3rHnC577MhaRo2CdS1QsaNY6mxuWb2j4 m/viwiWNVmZBSt4Pp4QBSFf7Hlt9QnWZOeu809HoCdJ2WWms4r4OVosWCpFj8GA9Eq5a VYPsph9dRaCS9zlD6tFNMQZSCrI+LFeqvOlGSKD/ShQqLu/YLLlkxJ8cLaF74ggGvbEx N+zA== X-Gm-Message-State: AOAM532lSVi228eQRbvMhH73hgK3qE3pmYQDc9shNkRohywyUcEEKwzA gg0uWcU2mgJRWDXipo9/r5x6jWLbocw= X-Google-Smtp-Source: ABdhPJwZKx4D7kzrspklHAF8lxEzQ+kshIU/F3nuenjwlxH5rXy4UcnweF6e+p34dDBD1gflHWhE7A== X-Received: by 2002:a2e:91d9:: with SMTP id u25mr32214089ljg.79.1609666681043; Sun, 03 Jan 2021 01:38:01 -0800 (PST) Received: from localhost.localdomain (host-189-203-5.junet.se. [207.189.203.5]) by smtp.gmail.com with ESMTPSA id h13sm7025202lfj.110.2021.01.03.01.38.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jan 2021 01:38:00 -0800 (PST) From: =?utf-8?q?Martin_=C3=85gren?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King Subject: [PATCH 3/3] t1300: don't needlessly work with `core.foo` configs Date: Sun, 3 Jan 2021 10:36:48 +0100 Message-Id: <20210103093649.2221-4-martin.agren@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210103093649.2221-1-martin.agren@gmail.com> References: <20210103093649.2221-1-martin.agren@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We use various made-up config keys in the "core" section for no real reason. Change them to work in the "section" section instead and be careful to also change "cores" to "sections". Make sure to also catch "Core", "CoReS" and similar. There are a few instances that actually want to work with a real "core" config such as `core.bare` or `core.editor`. After this, it's clearer that they work with "core" for a reason. Reported-by: Junio C Hamano Signed-off-by: Martin Ågren --- t/t1300-config.sh | 60 +++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 1439d870d6..1a4156c704 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -12,75 +12,75 @@ test_expect_success 'clear default config' ' ' cat > expect << EOF -[core] +[section] penguin = little blue EOF test_expect_success 'initial' ' - git config core.penguin "little blue" && + git config section.penguin "little blue" && test_cmp expect .git/config ' cat > expect << EOF -[core] +[section] penguin = little blue Movie = BadPhysics EOF test_expect_success 'mixed case' ' - git config Core.Movie BadPhysics && + git config Section.Movie BadPhysics && test_cmp expect .git/config ' cat > expect << EOF -[core] +[section] penguin = little blue Movie = BadPhysics -[Cores] +[Sections] WhatEver = Second EOF test_expect_success 'similar section' ' - git config Cores.WhatEver Second && + git config Sections.WhatEver Second && test_cmp expect .git/config ' cat > expect << EOF -[core] +[section] penguin = little blue Movie = BadPhysics UPPERCASE = true -[Cores] +[Sections] WhatEver = Second EOF test_expect_success 'uppercase section' ' - git config CORE.UPPERCASE true && + git config SECTION.UPPERCASE true && test_cmp expect .git/config ' test_expect_success 'replace with non-match' ' - git config core.penguin kingpin !blue + git config section.penguin kingpin !blue ' test_expect_success 'replace with non-match (actually matching)' ' - git config core.penguin "very blue" !kingpin + git config section.penguin "very blue" !kingpin ' cat > expect << EOF -[core] +[section] penguin = very blue Movie = BadPhysics UPPERCASE = true penguin = kingpin -[Cores] +[Sections] WhatEver = Second EOF test_expect_success 'non-match result' 'test_cmp expect .git/config' test_expect_success 'find mixed-case key by canonical name' ' - test_cmp_config Second cores.whatever + test_cmp_config Second sections.whatever ' test_expect_success 'find mixed-case key by non-canonical name' ' - test_cmp_config Second CoReS.WhAtEvEr + test_cmp_config Second SeCtIoNs.WhAtEvEr ' test_expect_success 'subsections are not canonicalized by git-config' ' @@ -1057,12 +1057,12 @@ test_expect_success 'git -c "key=value" support' ' true EOF { - git -c core.name=value config core.name && + git -c section.name=value config section.name && git -c foo.CamelCase=value config foo.camelcase && git -c foo.flag config --bool foo.flag } >actual && test_cmp expect actual && - test_must_fail git -c name=value config core.name + test_must_fail git -c name=value config section.name ' # We just need a type-specifier here that cares about the @@ -1107,7 +1107,7 @@ test_expect_success 'aliases can be CamelCased' ' test_expect_success 'git -c does not split values on equals' ' echo "value with = in it" >expect && - git -c core.foo="value with = in it" config core.foo >actual && + git -c section.foo="value with = in it" config section.foo >actual && test_cmp expect actual ' @@ -1838,53 +1838,53 @@ do done cat >.git/config <<-\EOF && -[core] +[section] foo = true number = 10 big = 1M EOF test_expect_success 'identical modern --type specifiers are allowed' ' - test_cmp_config 1048576 --type=int --type=int core.big + test_cmp_config 1048576 --type=int --type=int section.big ' test_expect_success 'identical legacy --type specifiers are allowed' ' - test_cmp_config 1048576 --int --int core.big + test_cmp_config 1048576 --int --int section.big ' test_expect_success 'identical mixed --type specifiers are allowed' ' - test_cmp_config 1048576 --int --type=int core.big + test_cmp_config 1048576 --int --type=int section.big ' test_expect_success 'non-identical modern --type specifiers are not allowed' ' - test_must_fail git config --type=int --type=bool core.big 2>error && + test_must_fail git config --type=int --type=bool section.big 2>error && test_i18ngrep "only one type at a time" error ' test_expect_success 'non-identical legacy --type specifiers are not allowed' ' - test_must_fail git config --int --bool core.big 2>error && + test_must_fail git config --int --bool section.big 2>error && test_i18ngrep "only one type at a time" error ' test_expect_success 'non-identical mixed --type specifiers are not allowed' ' - test_must_fail git config --type=int --bool core.big 2>error && + test_must_fail git config --type=int --bool section.big 2>error && test_i18ngrep "only one type at a time" error ' test_expect_success '--type allows valid type specifiers' ' - test_cmp_config true --type=bool core.foo + test_cmp_config true --type=bool section.foo ' test_expect_success '--no-type unsets type specifiers' ' - test_cmp_config 10 --type=bool --no-type core.number + test_cmp_config 10 --type=bool --no-type section.number ' test_expect_success 'unset type specifiers may be reset to conflicting ones' ' - test_cmp_config 1048576 --type=bool --no-type --type=int core.big + test_cmp_config 1048576 --type=bool --no-type --type=int section.big ' test_expect_success '--type rejects unknown specifiers' ' - test_must_fail git config --type=nonsense core.foo 2>error && + test_must_fail git config --type=nonsense section.foo 2>error && test_i18ngrep "unrecognized --type argument" error '