Re: [PATCH 2/2] merge-base: "--reflog" mode finds fork point from reflog entries
On Thu, Oct 24, 2013 at 3:11 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> 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
Show 6 quoted lines
> +
> + 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
Show 8 quoted lines
> +
> + # check defaulting to HEAD
> + git merge-base --reflog base >actual &&
> + test_cmp expect5 actual
> + )
> +'
> +
> test_done