Re: [PATCH v2 4/4] t5509: add basic tests for hideRefs
- From
Jeff King <peff@peff.net>
- Date
- Nov 4, 2015, 19:50 UTC
- Message-ID
- <20151104195042.GA16101@sigill.intra.peff.net>
- In-Reply-To
- <CAPig+cQWbisskb4aQ48Oo=8_SYKZWwMK8jn_P_zsivY-xuk43g@mail.gmail.com>
On Wed, Nov 04, 2015 at 02:36:54PM -0500, Eric Sunshine wrote:
Show 8 quoted lines
> > +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 <dir> ...", 2015-09-05) going by. Very cool.
-Peff