@@ -46,9 +46,11 @@ show_tool_names () {
while read scriptname
do
setup_tool "$scriptname" 2>/dev/null
- variants="$variants$(list_tool_variants)\n"
+ # We need an actual line feed here
+ variants="$variants
+$(list_tool_variants)"
done
- variants="$(echo "$variants" | sort | uniq)"
+ variants="$(echo "$variants" | sort -u)"
for toolname in $variants
do
@@ -828,4 +828,14 @@ test_expect_success 'mergetool -Oorder-file is honored' '
test_cmp expect actual
'
+test_expect_success 'mergetool --tool-help shows all recognized tools' '
+ # Remove fake tools added in previous tests
+ test_might_fail git config --unset merge.tool &&
+ test_might_fail git config --remove-section mergetool.mytool &&
+ test_might_fail git config --remove-section mergetool.mybase &&
+ git mergetool --tool-help >output &&
+ grep "$(printf "\t")" output >mergetools &&
+ test_line_count = 30 mergetools
+'
+
test_done