Junio C Hamano <gits...@pobox.com> writes:

> Galan RĂ©mi  <remi.galan-alfo...@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.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to