From: John Keeping Date: Tue, 26 Jul 2016 11:19:11 GMT Subject: Re: [PATCH v2 2/3] push: add shorthand for --force-with-lease branch creation Message-ID: <20160726111911.cehaitav4enas7dm@john.keeping.me.uk> In-Reply-To: <57973BAD.2020607@gmail.com> On Tue, Jul 26, 2016 at 12:30:05PM +0200, Jakub Narębski wrote: > W dniu 2016-07-25 o 23:59, John Keeping pisze: > > > +test_expect_success 'new branch covered by force-with-lease (explicit)' ' > > + setup_srcdst_basic && > > + ( > > + cd dst && > > + git branch branch master && > > + git push --force-with-lease=branch: origin branch > > + ) && > > + git ls-remote dst refs/heads/branch >expect && > > + git ls-remote src refs/heads/branch >actual && > > + test_cmp expect actual > > +' > > Do we need to test the negative, that is that if branch is not > new it prevents push (e.g. when is HEAD), or is it > covered by other tests? It's covered by a test in patch 3 (at least for the implicit case added there), but I could pull that forwards. In fact, converting that test to the explicit syntax will make it simpler since we won't need to set up a non-fast-forward push.