Re: [PATCH v3 2/2] git: submodule honor -c credential.* from command line
From: Eric Sunshine <hidden>
Date: 2016-06-15 23:08:29
On Thu, Feb 25, 2016 at 10:57:12AM -0800, Jacob Keller wrote:
quoted hunk ↗ jump to hunk
[...] 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 <redacted> ---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