From: Jeff King Date: Wed, 04 Nov 2015 19:50:42 GMT Subject: Re: [PATCH v2 4/4] t5509: add basic tests for hideRefs Message-ID: <20151104195042.GA16101@sigill.intra.peff.net> In-Reply-To: On Wed, Nov 04, 2015 at 02:36:54PM -0500, Eric Sunshine wrote: > > +test_expect_success 'try to update a hidden ref' ' > > + test_config -C pushee transfer.hideRefs refs/heads/master && > > + test_must_fail git -C original push pushee-namespaced master > > In above tests, you use -c to set the configuration temporarily for > the git invocation, but not in this and following tests. Is that > because the -c isn't visible to sub-commands which git-push invokes? > (Genuine question; I want to make sure I understand the reasoning.) Yes, we explicitly clear "-c" variables when we cross repo boundaries. You can do it like: git push --receive-pack='git -c transfer.hideRefs=... receive-pack' but that is probably more obfuscated than using test_config. I was going to complain that "test_config -C" does not actually work, but somehow I missed 5fafc07 (test-lib-functions: support "test_config -C ...", 2015-09-05) going by. Very cool. -Peff