Re: [PATCH] Test atomic git-commit --interactive
On Tue, May 10, 2011 at 12:43 PM, Jeff King <peff@peff.net> wrote:
Show 11 quoted lines
> On Tue, May 10, 2011 at 12:12:31PM -0700, Conrad Irwin wrote:
>
>> +test_expect_success PERL \
>> + "--interactive doesn't change index if editor aborts" \
>> + "EDITOR=false echo zoo >file && \
>
> This EDITOR bit does nothing, since it sets the value only for the
> "echo" command. The test happens to do what you want, though, since we
> set EDITOR to ":" in test-lib.sh, and that is also a fine value for your
> test (it's probably a better test, anyway; it simulates the user
> aborting with an empty message instead of the editor crashing).
> (EDITOR=: && export EDITOR &&
> test_must_fail git commit --interactive)
That makes sense, I was unaware of the : command, thank you.
> You can drop the backslash-continuation on lines that end with "&&" or
> "|", which makes things a bit more readable.
> So the result should look like: