Code

mergetool-lib: combine vimdiff and gvimdiff run blocks
authorDan McGee <dpmcgee@gmail.com>
Wed, 15 Sep 2010 02:21:42 +0000 (21:21 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Sep 2010 17:14:15 +0000 (10:14 -0700)
They are nearly identical outside of the foreground flag, which can safely
be passed to both vim and gvim. The merge tool itself is named in
$merge_tool_path.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-mergetool--lib.sh

index b5e1943b1d166b543998c80579c65e82de36516a..f9a51ba50448c8e275c14e0e33afa31239c890a9 100644 (file)
@@ -169,25 +169,14 @@ run_merge_tool () {
                        "$merge_tool_path" "$LOCAL" "$REMOTE" | cat
                fi
                ;;
-       vimdiff)
-               if merge_mode; then
-                       touch "$BACKUP"
-                       "$merge_tool_path" -d -c "wincmd l" \
-                               "$LOCAL" "$MERGED" "$REMOTE"
-                       check_unchanged
-               else
-                       "$merge_tool_path" -d -c "wincmd l" \
-                               "$LOCAL" "$REMOTE"
-               fi
-               ;;
-       gvimdiff)
+       vimdiff|gvimdiff)
                if merge_mode; then
                        touch "$BACKUP"
-                       "$merge_tool_path" -d -c "wincmd l" -f \
+                       "$merge_tool_path" -f -d -c "wincmd l" \
                                "$LOCAL" "$MERGED" "$REMOTE"
                        check_unchanged
                else
-                       "$merge_tool_path" -d -c "wincmd l" -f \
+                       "$merge_tool_path" -f -d -c "wincmd l" \
                                "$LOCAL" "$REMOTE"
                fi
                ;;