Skip to content

Commit 64971f0

Browse files
committed
Merge branch 'pb/mergetool-tool-help-fix' into maint
Fix 2.29 regression where "git mergetool --tool-help" fails to list all the available tools. * pb/mergetool-tool-help-fix: mergetool--lib: fix '--tool-help' to correctly show available tools
2 parents 897d28b + 80f5a16 commit 64971f0

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

git-mergetool--lib.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ show_tool_names () {
4646
while read scriptname
4747
do
4848
setup_tool "$scriptname" 2>/dev/null
49-
variants="$variants$(list_tool_variants)\n"
49+
# We need an actual line feed here
50+
variants="$variants
51+
$(list_tool_variants)"
5052
done
51-
variants="$(echo "$variants" | sort | uniq)"
53+
variants="$(echo "$variants" | sort -u)"
5254

5355
for toolname in $variants
5456
do

t/t7610-mergetool.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,4 +828,15 @@ test_expect_success 'mergetool -Oorder-file is honored' '
828828
test_cmp expect actual
829829
'
830830

831+
test_expect_success 'mergetool --tool-help shows recognized tools' '
832+
# Check a few known tools are correctly shown
833+
git mergetool --tool-help >mergetools &&
834+
grep vimdiff mergetools &&
835+
grep vimdiff3 mergetools &&
836+
grep gvimdiff2 mergetools &&
837+
grep araxis mergetools &&
838+
grep xxdiff mergetools &&
839+
grep meld mergetools
840+
'
841+
831842
test_done

0 commit comments

Comments
 (0)