Re: [PATCH 1/6] t/checkout-last: checkout - doesn't work after rebase
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 13, 2013, 17:46 UTC
- Message-ID
- <7vfvwlvr7e.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1371130349-30651-2-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 10 quoted lines
> The following command > > $ git checkout - > > does not work as expected after a rebase. Every kind of rebase must > behave in the exactly same way: for the purposes of checkout -, the > rebase event should be inconsequential. > > Add two failing tests documenting this bug: one for a normal rebase, and > another for an interactive rebase.
Why two?
After the discussion, I would have expected to see the two argument form:
git rebase [-i] master other
started on the 'other' branch and also started on a branch that is
not 'master' or 'other', also be tested to specify the desired
behaviour in these cases.Show 31 quoted lines
> > Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> > --- > t/t2012-checkout-last.sh | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/t/t2012-checkout-last.sh b/t/t2012-checkout-last.sh > index b44de9d..ae6d319 100755 > --- a/t/t2012-checkout-last.sh > +++ b/t/t2012-checkout-last.sh > @@ -116,4 +116,20 @@ test_expect_success 'master...' ' > test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)" > ' > > +test_expect_failure '"checkout -" works after a rebase' ' > + git checkout master && > + git checkout other && > + git rebase master && > + git checkout - && > + test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master" > +' > + > +test_expect_failure '"checkout -" works after an interactive rebase' ' > + git checkout master && > + git checkout other && > + git rebase -i master && > + git checkout - && > + test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master" > +' > + > test_done