Re: [PATCH 2/2] receive-pack: support push-to-checkout hook
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 2, 2014, 16:45 UTC
- Message-ID
- <alpine.DEB.1.00.1412021744490.13845@s15462909.onlinehome-server.info>
- In-Reply-To
- <xmqqtx1em2fu.fsf@gitster.dls.corp.google.com>
Hi Junio,
On Tue, 2 Dec 2014, Junio C Hamano wrote:
Show 28 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > In this particular case, I think that we really, really *just* need to > > verify that the presence of the hook switches off the default behavior of > > updateInstead. *Nothing* else is needed to verify that this particular > > functionality hasn't regressed. I.e. something like: > > > > +test_expect_success 'updateInstead with push-to-checkout hook' ' > > + rm -fr testrepo && > > + git clone . testrepo && > > + ( > > + cd testrepo && > > + echo unclean > path1 && > > + git config receive.denyCurrentBranch updateInstead && > > + echo 'touch yep' | write_script .git/hooks/push-to-checkout > > + ) && > > + git push testrepo HEAD^:refs/heads/master && > > + test unclean = $(cat testrepo/path1) && > > + test -f testrepo/yep > > +' > > > > would be more appropriate (although it probably has one or three bugs, > > given that I wrote this in the mailer). > > Not really. You need to remember that we write tests not to show > off the new shiny, but to protect essential invariants from being > broken by careless others attempting to rewrite the implementation > in the future.
Fair enough. You are the boss.
I am not, therefore it does not matter what I think, Johannes