@matheusbsbs / matheus-bagliano / commits / 85bf49f9a5
Fork 0

octopus: reenable fast-forward merges

The fast-forward logic is never being triggered because $common and $MRC are never equivalent. $common is initialized to a commit id by merge-base and MRC is initialized to HEAD. Fix this by initializing $MRC to the commit id for HEAD so that its possible for $MRC and $common to be equal. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stephen Boyd committed Dec 11, 2009 at 16:38 UTC 85bf49f9a55fd9ded396460d245a55b651d7bdaa
2 files changed +19 -1
git-merge-octopus.sh
+1 -1
@@ -44,7 +44,7 @@ esac
44 # MRC is the current "merge reference commit"
45 # MRT is the current "merge result tree"
46
47 -MRC=$head MSG= PARENT="-p $head"
47 +MRC=$(git rev-parse --verify -q $head) MSG= PARENT="-p $head"
48 MRT=$(git write-tree)
49 CNT=1 ;# counting our head
50 NON_FF_MERGE=0
t/t7602-merge-octopus-many.sh
+18
@@ -82,4 +82,22 @@ test_expect_success 'merge up-to-date output uses pretty names' '
82 git merge c4 c5 >actual &&
83 test_cmp actual expected
84 '
85 +
86 +cat >expected <<\EOF
87 +Fast-forwarding to: c1
88 +Trying simple merge with c2
89 +Merge made by octopus.
90 + c1.c | 1 +
91 + c2.c | 1 +
92 + 2 files changed, 2 insertions(+), 0 deletions(-)
93 + create mode 100644 c1.c
94 + create mode 100644 c2.c
95 +EOF
96 +
97 +test_expect_success 'merge fast-forward output uses pretty names' '
98 + git reset --hard c0 &&
99 + git merge c1 c2 >actual &&
100 + test_cmp actual expected
101 +'
102 +
103 test_done