From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id BA3611F46C for ; Fri, 24 Jan 2020 00:21:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729794AbgAXAVO (ORCPT ); Thu, 23 Jan 2020 19:21:14 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52775 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729017AbgAXAVN (ORCPT ); Thu, 23 Jan 2020 19:21:13 -0500 Received: by mail-wm1-f67.google.com with SMTP id p9so91551wmc.2 for ; Thu, 23 Jan 2020 16:21:11 -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=Vzbm2jbZgmjXl+MHBE3DtIUgRyeqxuVjjO8cWWLto1M=; b=nuh34G7TwZWBCQCq22YQUEd3sy4wOgy1AxYZnPvrEmDaE6dpliSka1OYnQDMYxfSww FrdaOGB7PzkaA1UE9EqEcc6a/Dj4DmAeeUYeNsyf6SlmhsRDnO7UdAkFCjSqZTUllMmX mkQvtd/r2gZnLv9jjsYjZ7gKpNG5aBPID3FZLmVt7m1uFoh5sjb55YUi8XyPU24CEVfU /pgD3lW62Rc2H/rwxLUUwy8k7IJmetJBO4EMIDC8K//Js+JiH2k6v4EahVWL44IfcwLC K6YtdAly+ZV2htC5FkHJUHewXI3WHcqtpBSDjJhaCJi9l1GdtuHN4S1vWNFGHhYx9VFG BoRQ== 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=Vzbm2jbZgmjXl+MHBE3DtIUgRyeqxuVjjO8cWWLto1M=; b=Rr2GAhDCbOGBbWO8cyd5NMavdzDWu3R35p5azx1xR9Fyi7MxAVBCRP0lAe05aB0nCR +1PHcae7OOR7eVK2YKpQehlJb3yxe/QPcHjFhS/eDysfGiCnt97Uc3Ni6ySMRZcDCRKU /hRgBhEhNhfVnkX0lQdGC390WuTtuRSE1S12+A9gdd3Yr2pMX93wfY64FJt/t/dphwaj 9fQh5RQdUwT2wV0K+6xlGzbVQola0JZXDqVogSkXeeXhqOBlwk2JkoIpjPcL4nYRWXIJ f2UE0euQbVGz6sq+s8uLkKExdrWGOf+ALGuCjKsrGhzO9Rd05ItBUvazzR27pT2KXsB8 m6pA== X-Gm-Message-State: APjAAAWAmuINiyCkezU8qIIOfKQqr1gXUsHbEBa7UgleNgNtluUTifF+ EBbRfcBvpFmd5HYsCM6Y22dh9Icg X-Google-Smtp-Source: APXvYqzlOf97SIdyCWfq4i8DocVLuvE1TxnRelPzHPEb4X+EzKgatGMYWTkeumVDIwoykWnzKOt4uA== X-Received: by 2002:a05:600c:291d:: with SMTP id i29mr486392wmd.39.1579825270969; Thu, 23 Jan 2020 16:21:10 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u7sm4617041wmj.3.2020.01.23.16.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 16:21:10 -0800 (PST) Message-Id: <9d19794dfd667b3f9752f0e8118dc9eb0c8f59f1.1579825267.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Matthew Rogers via GitGitGadget" Date: Fri, 24 Jan 2020 00:21:03 +0000 Subject: [PATCH v4 3/6] t1300: create custom config file without special characters Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 To: git@vger.kernel.org Cc: Matthew Rogers , Matthew Rogers Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Matthew Rogers Tests that required a custom configuration file to be created previously used a file with non-alphanumeric characters including escaped double quotes. This is not really necessary for the majority of tests involving custom config files, and decreases test coverage on systems that dissallow such filenames (Windows, etc.). Create two files, one appropriate for testing quoting and one appropriate for general use. Signed-off-by: Matthew Rogers --- t/t1300-config.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/t/t1300-config.sh b/t/t1300-config.sh index e8b4575758..e5fb9114f6 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -1710,18 +1710,23 @@ test_expect_success '--show-origin getting a single key' ' ' test_expect_success 'set up custom config file' ' - CUSTOM_CONFIG_FILE="file\" (dq) and spaces.conf" && + CUSTOM_CONFIG_FILE="custom.conf" && cat >"$CUSTOM_CONFIG_FILE" <<-\EOF [user] custom = true EOF ' +test_expect_success !MINGW 'set up custom config file with special name characters' ' + WEIRDLY_NAMED_FILE="file\" (dq) and spaces.conf" && + cp "$CUSTOM_CONFIG_FILE" "$WEIRDLY_NAMED_FILE" +' + test_expect_success !MINGW '--show-origin escape special file name characters' ' cat >expect <<-\EOF && file:"file\" (dq) and spaces.conf" user.custom=true EOF - git config --file "$CUSTOM_CONFIG_FILE" --show-origin --list >output && + git config --file "$WEIRDLY_NAMED_FILE" --show-origin --list >output && test_cmp expect output ' @@ -1747,7 +1752,7 @@ test_expect_success '--show-origin stdin with file include' ' test_cmp expect output ' -test_expect_success !MINGW '--show-origin blob' ' +test_expect_success '--show-origin blob' ' blob=$(git hash-object -w "$CUSTOM_CONFIG_FILE") && cat >expect <<-EOF && blob:$blob user.custom=true @@ -1756,9 +1761,9 @@ test_expect_success !MINGW '--show-origin blob' ' test_cmp expect output ' -test_expect_success !MINGW '--show-origin blob ref' ' +test_expect_success '--show-origin blob ref' ' cat >expect <<-\EOF && - blob:"master:file\" (dq) and spaces.conf" user.custom=true + blob:master:custom.conf user.custom=true EOF git add "$CUSTOM_CONFIG_FILE" && git commit -m "new config file" && -- gitgitgadget