Subject: [PATCH 2/3] mergetool-lib: specialize xxdiff options when in diff mode

From: David Aguilar <[email-masked]>
Date: Thu, 2 Apr 2009 03:30:45 -0700

We don't need '-merged-file', 'save as', and the merge-status exit
code when in diff mode

Signed-off-by: David Aguilar <[email-masked]>
---
 git-mergetool-lib.sh |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/git-mergetool-lib.sh b/git-mergetool-lib.sh
index e2d074d..3ba332b 100644
--- a/git-mergetool-lib.sh
+++ b/git-mergetool-lib.sh
@@ -127,7 +127,9 @@ run_mergetool () {
 		fi
 		;;
 	xxdiff)
-		merge_mode && touch "$BACKUP"
+		if merge_mode; then
+			touch "$BACKUP"
+		fi
 		if $base_present; then
 			"$merge_tool_path" -X --show-merged-pane \
 			    -R 'Accel.SaveAsMerged: "Ctrl-S"' \
@@ -135,12 +137,18 @@ run_mergetool () {
 			    -R 'Accel.SearchForward: "Ctrl-G"' \
 			    --merged-file "$MERGED" "$LOCAL" "$BASE" "$REMOTE"
 		else
-			merge_mode && extra=--show-merged-pane
-			"$merge_tool_path" -X $extra \
-				-R 'Accel.SaveAsMerged: "Ctrl-S"' \
-				-R 'Accel.Search: "Ctrl+F"' \
-				-R 'Accel.SearchForward: "Ctrl-G"' \
-				--merged-file "$MERGED" "$LOCAL" "$REMOTE"
+			if merge_mode; then
+				"$merge_tool_path" -X $extra \
+					-R 'Accel.SaveAsMerged: "Ctrl-S"' \
+					-R 'Accel.Search: "Ctrl+F"' \
+					-R 'Accel.SearchForward: "Ctrl-G"' \
+					--merged-file "$MERGED" "$LOCAL" "$REMOTE"
+			else
+				"$merge_tool_path" \
+					-R 'Accel.Search: "Ctrl+F"' \
+					-R 'Accel.SearchForward: "Ctrl-G"' \
+					"$LOCAL" "$REMOTE"
+			fi
 		fi
 		check_unchanged
 		;;
-- 
1.6.2.1.303.g63699