summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2010-09-15 02:21:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-09-15 17:14:15 (GMT)
commitae69fd0481fa7bb39ee9ee68dc2e009d500e3b1d (patch)
tree3669d03d893c745e1ac5792a040c1ff7d2f41961
parent5879b6bbcaba7696e4abfa717748da166f915405 (diff)
downloadgit-ae69fd0481fa7bb39ee9ee68dc2e009d500e3b1d.zip
git-ae69fd0481fa7bb39ee9ee68dc2e009d500e3b1d.tar.gz
git-ae69fd0481fa7bb39ee9ee68dc2e009d500e3b1d.tar.bz2
mergetool-lib: combine vimdiff and gvimdiff run blocks
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>
-rw-r--r--git-mergetool--lib.sh17
1 files changed, 3 insertions, 14 deletions
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index b5e1943..f9a51ba 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -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
;;