Skip to content

Commit 98efc8f

Browse files
author
Junio C Hamano
committed
octopus: allow manual resolve on the last round.
Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 9e9b267 commit 98efc8f

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

git-merge-octopus.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,19 @@ MRC=$head MSG= PARENT="-p $head"
4848
MRT=$(git-write-tree)
4949
CNT=1 ;# counting our head
5050
NON_FF_MERGE=0
51+
OCTOPUS_FAILURE=0
5152
for SHA1 in $remotes
5253
do
54+
case "$OCTOPUS_FAILURE" in
55+
1)
56+
# We allow only last one to have a hand-resolvable
57+
# conflicts. Last round failed and we still had
58+
# a head to merge.
59+
echo "Automated merge did not work."
60+
echo "Should not be doing an Octopus."
61+
exit 2
62+
esac
63+
5364
common=$(git-merge-base --all $MRC $SHA1) ||
5465
die "Unable to find common commit with $SHA1"
5566

@@ -84,11 +95,8 @@ do
8495
if test $? -ne 0
8596
then
8697
echo "Simple merge did not work, trying automatic merge."
87-
git-merge-index -o git-merge-one-file -a || {
88-
echo "Not trivially merged."
89-
echo "Should not be doing an Octopus."
90-
exit 2
91-
}
98+
git-merge-index -o git-merge-one-file -a ||
99+
OCTOPUS_FAILURE=1
92100
next=$(git-write-tree 2>/dev/null)
93101
fi
94102

@@ -103,4 +111,4 @@ do
103111
MRT=$next
104112
done
105113

106-
exit 0
114+
exit "$OCTOPUS_FAILURE"

0 commit comments

Comments
 (0)