Skip to content

Commit f67986b

Browse files
Michael J Grubergitster
authored andcommitted
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>
1 parent 3e4f237 commit f67986b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

git-mergetool--lib.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ guess_merge_tool () {
305305
EOF
306306

307307
# Loop over each candidate and stop when a valid merge tool is found.
308+
IFS=' '
308309
for tool in $tools
309310
do
310311
is_available "$tool" && echo "$tool" && return 0

0 commit comments

Comments
 (0)