Skip to content

Commit c157c07

Browse files
committed
mergetool: avoid letting list_tool_variants break user-defined setups
In 83bbf9b (mergetool--lib: improve support for vimdiff-style tool variants, 2020-07-29), we introduced a `list_tool_variants` function in the spirit of Postel's Law: be lenient in what you accept as input. In this particular instance, we wanted to allow not only `bc` but also `bc3` as name for the Beyond Compare tool. However, what this patch overlooked is that it is totally allowed for users to override the defaults in `mergetools/`. But now that we strip off trailing digits, the name that the user gave the tool might not actually be in the list produced by `list_tool_variants`. So let's do the same as for the `diff_cmd` and the `merge_cmd`: override it with the trivial version in case a user-defined setup was detected. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 0e2b11a commit c157c07

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

git-mergetool--lib.sh

+4
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ setup_user_tool () {
138138
merge_cmd () {
139139
( eval $merge_tool_cmd )
140140
}
141+
142+
list_tool_variants () {
143+
echo "$tool"
144+
}
141145
}
142146

143147
setup_tool () {

0 commit comments

Comments
 (0)