Re: [PATCH v2 03/12] t5520: test work tree fast-forward when fetch updates head
- From
Paul Tan <pyokagan@gmail.com>
- Date
- May 7, 2015, 17:32 UTC
- Message-ID
- <CACRoPnR_T95p+FeLLiQViBiE5z9H3XAEUA5pokuG4B5nns0H0A@mail.gmail.com>
- In-Reply-To
- <xmqqoalwqpk4.fsf@gitster.dls.corp.google.com>
Hi Junio,
On Fri, May 8, 2015 at 1:12 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 17 quoted lines
> Paul Tan <pyokagan@gmail.com> writes: > >> +test_expect_success 'fast-forward fails with conflicting work tree' ' >> + git checkout -b third master^ && >> + test_when_finished "git checkout -f copy && git branch -D third" && >> + echo file >expected && >> + test_cmp expected file && >> + echo conflict >file && >> + test_must_fail git pull . second:third 2>out && >> + test_i18ngrep "Cannot fast-forward your working tree" out && >> + test `cat file` = conflict > > At this point, HEAD would match either master^ (as initially checked > out) or second (as fetch fast-forwarded), but I cannot read what this > test is expecting to happen. > > Should the HEAD move or stay?
Ugh, it was probably me getting confused by all the test dependencies :-(.
Anyway, second^ == master^ == the initial commit at this point, so it would be clearer to write "git checkout -b third second^", I think.
The HEAD has already moved because git-fetch updated it. I should definitely add a check to make that clear.
Whether it should or not is something I have an answer to yet though.
Thanks, Paul