This will make it easier to use setup_tool in places where we expect
that the selected tool will not support the current mode.

Signed-off-by: John Keeping <j...@keeping.me.uk>
---
 git-mergetool--lib.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 4c1e129..c6bd8ba 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -67,11 +67,11 @@ setup_tool () {
        if merge_mode && ! can_merge
        then
                echo "error: '$tool' can not be used to resolve merges" >&2
-               exit 1
+               return 1
        elif diff_mode && ! can_diff
        then
                echo "error: '$tool' can only be used to resolve merges" >&2
-               exit 1
+               return 1
        fi
        return 0
 }
@@ -100,7 +100,7 @@ run_merge_tool () {
        status=0
 
        # Bring tool-specific functions into scope
-       setup_tool "$1"
+       setup_tool "$1" || return
 
        if merge_mode
        then
-- 
1.8.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to