Skip to content

Commit

Permalink
mergetool-lib: combine vimdiff and gvimdiff run blocks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan McGee authored and Junio C Hamano committed Sep 15, 2010
1 parent 5879b6b commit ae69fd0
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions git-mergetool--lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down

0 comments on commit ae69fd0

Please sign in to comment.