1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-19 17:36:08 +02:00

mergetool-lib: fix default tool selection

When no diff nor merge tool is specified (config, option), mergetool-lib
is supposed to choose a default tool from a set of tools. That set is
constructed dynamically depending on the environment (graphical, editor
setting) as a space separated string of tool names.

719518f (mergetool--lib: set IFS for difftool and mergetool, 2015-05-20)
introduced a newline as IFS which breaks the parsing of the space
separated list into items, resulting in a failed search for an available
tool.

Set IFS to a space locally for the tool search.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael J Gruber 2015-06-19 11:30:55 +02:00 committed by Junio C Hamano
parent 3e4f2373b2
commit f67986b909

View File

@ -305,6 +305,7 @@ guess_merge_tool () {
EOF
# Loop over each candidate and stop when a valid merge tool is found.
IFS=' '
for tool in $tools
do
is_available "$tool" && echo "$tool" && return 0