Re: [PATCH v3 2/2] git: submodule honor -c credential.* from command line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 25, 2016 at 10:57:12AM -0800, Jacob Keller wrote:
> [...]
> Replace all the calls to clear_local_git_env with a wrapped function
> that filters GIT_CONFIG_PARAMETERS using the new helper and then
> restores it to the filtered subset after clearing the rest of the
> environment.
> 
> Signed-off-by: Jacob Keller <jacob.keller@xxxxxxxxx>
> ---
> diff --git a/t/t7412-submodule--helper.sh b/t/t7412-submodule--helper.sh
> @@ -0,0 +1,25 @@
> +test_expect_success 'sanitize-config keeps credential.helper' '
> +	git -c credential.helper="helper" submodule--helper sanitize-config >actual &&
> +	echo "'\''credential.helper=helper'\''" >expect &&

Not worth a re-roll, but these quote sequences are brain-melting.
Easier would have been to double-quote the second argument of
test_expect_success() and then do either:

    test_expect_success 'sanitize-config keeps credential.helper' "
        git -c [...] submodule--helper sanitize-config >actual &&
        echo \'credential.helper=helper\' >expect &&
        test_cmp expect actual
    "

or:

    test_expect_success 'sanitize-config keeps credential.helper' "
        git -c [...] submodule--helper sanitize-config >actual &&
        cat >expect <<-\EOF &&
        'credential.helper=helper'
        EOF
        test_cmp expect actual
    "

> +	test_cmp expect actual
> +'
> +
> +test_done
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]