Re: [PATCH] Introduce receive.denyDeletes
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Oct 31, 2008, 14:30 UTC
- Message-ID
- <20081031143022.GQ14786@spearce.org>
- In-Reply-To
- <7v63n99omx.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> "Jan Krüger" <jk@jk.gs> writes: > > > Can I then delete the branch afterwards without lots of juggling (in > > case the test fails due to a random other reason that the branch > > accidentally getting deleted by receive-pack)? I'd expect I'd have to > > save the exit code to a temporary variable and that's just as ugly.
If you want to delete the branch after the test is done, do it outside of the test_expect_success's 3rd argument. Then it will run the branch deletion whether or not the test was successful.
Show 5 quoted lines
> Although I agree that your attempt to allow the test continue even when > this test fails is a very good practice, I personally do not find the > alternative you mention ugly at all. I actually find that "return 1" > uglier because it feels like it knows too much about how > test_expect_success is implemented.
Yea, I also found the "return 1" to be horribly difficult to read, and knowing far too much about the test suite.
-- Shawn.