Re: [PATCH 4/4] t: branch: improve test rollback
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Sep 3, 2013, 22:10 UTC
- Message-ID
- <CAMP44s2BU86zZ_KE78BPYpsjBZJ7Mj0MJqM4Lj28AKxYfeLVDQ@mail.gmail.com>
- In-Reply-To
- <xmqqwqmxr9a7.fsf@gitster.dls.corp.google.com>
On Tue, Sep 3, 2013 at 2:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 8 quoted lines
>> test_expect_success 'refuse --edit-description on unborn branch for now' '
>> + test_when_finished "git checkout -" &&
>
> I am not sure if this is a good change. Depending on the outcome of
> the "git checkout" in the test (it may succeed and set @{-1} to the
> branch we were on when we entered the test, or it may fail and leave
> @{-1} to the branch before we were on when we entered the test),
> this will take us to a different place, no?It is better than leaving Git in an unborn branch. Many tests could not care which is the current branch, as long as HEAD does points to a branch, and that is the default, the tests should be messing with the default.
-- Felipe Contreras