summaryrefslogtreecommitdiff
path: root/git-mergetool--lib.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-25 19:45:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-11-25 19:45:07 (GMT)
commitad7ace714d353ef49045bc37c1363e8fc904792d (patch)
tree7cefc4953bac3061de09d5380719f12c6e4fcef3 /git-mergetool--lib.sh
parentb073b7a990deb1cb3425db45642fa18c8b3cb65c (diff)
parente1622bfcbad680225ad5c337e4778df88389227e (diff)
downloadgit-ad7ace714d353ef49045bc37c1363e8fc904792d.zip
git-ad7ace714d353ef49045bc37c1363e8fc904792d.tar.gz
git-ad7ace714d353ef49045bc37c1363e8fc904792d.tar.bz2
Merge branch 'rs/work-around-grep-opt-insanity'
* rs/work-around-grep-opt-insanity: Protect scripted Porcelains from GREP_OPTIONS insanity mergetool--lib: simplify guess_merge_tool() Conflicts: git-instaweb.sh
Diffstat (limited to 'git-mergetool--lib.sh')
-rw-r--r--git-mergetool--lib.sh13
1 files changed, 6 insertions, 7 deletions
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index f7c571e..5b62785 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -338,15 +338,14 @@ guess_merge_tool () {
fi
tools="$tools gvimdiff diffuse ecmerge p4merge araxis"
fi
- if echo "${VISUAL:-$EDITOR}" | grep emacs > /dev/null 2>&1; then
- # $EDITOR is emacs so add emerge as a candidate
- tools="$tools emerge vimdiff"
- elif echo "${VISUAL:-$EDITOR}" | grep vim > /dev/null 2>&1; then
- # $EDITOR is vim so add vimdiff as a candidate
+ case "${VISUAL:-$EDITOR}" in
+ *vim*)
tools="$tools vimdiff emerge"
- else
+ ;;
+ *)
tools="$tools emerge vimdiff"
- fi
+ ;;
+ esac
echo >&2 "merge tool candidates: $tools"
# Loop over each candidate and stop when a valid merge tool is found.