Thread (14 messages) 14 messages, 5 authors, 2016-06-15

Re: [PATCH 2/2] merge-base: "--reflog" mode finds fork point from reflog entries

From: Eric Sunshine <hidden>
Date: 2016-06-15 22:59:04

On Thu, Oct 24, 2013 at 3:11 PM, Junio C Hamano [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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?
quoted hunk ↗ jump to hunk
+
+               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?
quoted hunk ↗ jump to hunk
+
+               # check defaulting to HEAD
+               git merge-base --reflog base >actual &&
+               test_cmp expect5 actual
+       )
+'
+
 test_done
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help