summaryrefslogtreecommitdiff
path: root/git-mergetool--lib.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-11-11 20:33:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-11 21:00:11 (GMT)
commit12026f46e73ba09b8c403079bccc72a3b85e8dc9 (patch)
tree3b8f2f551c9f04b9601b8d24b79fc801eec9dd8a /git-mergetool--lib.sh
parent6bc9082c0fa37d25b7cf9c3ab3c85c78c7a19daf (diff)
downloadgit-12026f46e73ba09b8c403079bccc72a3b85e8dc9.zip
git-12026f46e73ba09b8c403079bccc72a3b85e8dc9.tar.gz
git-12026f46e73ba09b8c403079bccc72a3b85e8dc9.tar.bz2
mergetool: avoid letting `list_tool_variants` break user-defined setups
In 83bbf9b92ea8 (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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-mergetool--lib.sh')
-rw-r--r--git-mergetool--lib.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 2defef2..7225abd 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -138,6 +138,10 @@ setup_user_tool () {
merge_cmd () {
( eval $merge_tool_cmd )
}
+
+ list_tool_variants () {
+ echo "$tool"
+ }
}
setup_tool () {