@matheusbsbs / matheus-bagliano / commits / 98efc8f3d8
Fork 0

octopus: allow manual resolve on the last round.

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Jan 13, 2006 at 16:45 UTC 98efc8f3d890a0c671b7e2000e43b2e0a96b9a73
1 file changed +14 -6
git-merge-octopus.sh
+14 -6
@@ -48,8 +48,19 @@ MRC=$head MSG= PARENT="-p $head"
48 MRT=$(git-write-tree)
49 CNT=1 ;# counting our head
50 NON_FF_MERGE=0
51 +OCTOPUS_FAILURE=0
52 for SHA1 in $remotes
53 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 +
64 common=$(git-merge-base --all $MRC $SHA1) ||
65 die "Unable to find common commit with $SHA1"
66
@@ -84,11 +95,8 @@ do
95 if test $? -ne 0
96 then
97 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
100 next=$(git-write-tree 2>/dev/null)
101 fi
102
@@ -103,4 +111,4 @@ do
111 MRT=$next
112 done
113
106 -exit 0
114 +exit "$OCTOPUS_FAILURE"