From: Eric Sunshine Date: Fri, 26 Feb 2016 01:55:10 GMT Subject: Re: [PATCH v3 2/2] git: submodule honor -c credential.* from command line Message-ID: <20160226015510.GA5347@flurp.local> In-Reply-To: <1456426632-23257-2-git-send-email-jacob.e.keller@intel.com> 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 > --- > 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