Re: [PATCHv6 1/3] git-rebase -i: add command "drop" to remove a commit
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 23, 2015, 20:37 UTC
- Message-ID
- <xmqqegl2cga9.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <xmqqwpyucjj1.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> Galan Rémi <remi.galan-alfonso@ensimag.grenoble-inp.fr> writes:
>
>> +test_rebase_end () {
>> + test_when_finished "git checkout master &&
>> + git branch -D $1 &&
>
> Is this one guaranteed to succeed? Do we want to consider it a
> failure to remove "$1" (e.g. dropTest)?
>
> $ git branch -D no-such-branch ; echo $?
> error: branch 'no-such-branch' not found.
> 1
>
> If dropTest branch did not exist before the test that begins with
> a call to this function, what happens?
>
> Besides, a function that must be called at the beginning of a test
> piece has a name that ends with _end? That sounds funny, no?Ah, scratch this last paragraph. I didn't see this is a multi-command "when_finished".
But other parts of what I said still stands. For example, even in a multi-command "when_finished", "git branch -D $1 &&" if the main body of the test failed to create the branch "$1", that command would fail and skip the remainder of the clean-up, so the first point above is still suspect.