From: Eric Sunshine Date: Thu, 24 Oct 2013 21:01:56 GMT Subject: Re: [PATCH 2/2] merge-base: "--reflog" mode finds fork point from reflog entries Message-ID: In-Reply-To: <1382641884-14756-3-git-send-email-gitster@pobox.com> On Thu, Oct 24, 2013 at 3:11 PM, Junio C Hamano wrote: > diff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh > index f80bba8..3a1abee 100755 > --- a/t/t6010-merge-base.sh > +++ b/t/t6010-merge-base.sh > @@ -230,4 +230,31 @@ test_expect_success 'criss-cross merge-base for octopus-step' ' > test_cmp expected.sorted actual.sorted > ' > > +test_expect_success 'using reflog to find the fork point' ' > + git reset --hard && > + git checkout -b base $E && > + ( > + for count in 1 2 3 4 5 > + do > + git commit --allow-empty -m "Base commit #$count" && > + git rev-parse HEAD >expect$count && > + git checkout -B derived && > + git commit --allow-empty -m "Derived #$count" && > + git rev-parse HEAD >derived$count && > + git checkout base && > + count=$(( $count + 1 )) || exit 1 > + done Did you want && here? > + > + for count in 1 2 3 4 5 > + do > + git merge-base --reflog base $(cat derived$count) >actual && > + test_cmp expect$count actual || exit 1 > + done And here? > + > + # check defaulting to HEAD > + git merge-base --reflog base >actual && > + test_cmp expect5 actual > + ) > +' > + > test_done