merge --no-commit: tweak message
We did not distinguish the case the user asked not to make a commit with --no-commit flag and the automerge failed. Tell these cases apart and phrase dying message differently. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Dec 23, 2005 at 15:48 UTC
695bf722da848e0cd2692bc07c4a2773c52b4216
1 file changed
+10
-1
git-merge.sh
+10
-1
@@ -209,6 +209,7 @@ case "$use_strategies" in
209
esac
210
211
result_tree= best_cnt=-1 best_strategy= wt_strategy=
212
+merge_was_ok=
213
for strategy in $use_strategies
214
do
215
test "$wt_strategy" = '' || {
@@ -228,6 +229,7 @@ do
229
exit=$?
230
if test "$no_commit" = t && test "$exit" = 0
231
then
232
+ merge_was_ok=t
233
exit=1 ;# pretend it left conflicts.
234
fi
235
@@ -293,4 +295,11 @@ do
295
done >"$GIT_DIR/MERGE_HEAD"
296
echo $merge_msg >"$GIT_DIR/MERGE_MSG"
297
296
-die "Automatic merge failed/prevented; fix up by hand"
298
+if test "$merge_was_ok" = t
299
+then
300
+ echo >&2 \
301
+ "Automatic merge went well; stopped before committing as requested"
302
+ exit 0
303
+else
304
+ die "Automatic merge failed; fix up by hand"
305
+fi