summaryrefslogtreecommitdiff
path: root/git-difftool--helper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-difftool--helper.sh')
-rwxr-xr-xgit-difftool--helper.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 46af3e6..dd0c9a5 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -61,6 +61,9 @@ launch_merge_tool () {
export BASE
eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"'
else
+ initialize_merge_tool "$merge_tool"
+ # ignore the error from the above --- run_merge_tool
+ # will diagnose unusable tool by itself
run_merge_tool "$merge_tool"
fi
}
@@ -72,6 +75,11 @@ then
merge_tool="$GIT_DIFF_TOOL"
else
merge_tool="$(get_merge_tool)"
+ subshell_exit_status=$?
+ if test $subshell_exit_status -gt 1
+ then
+ exit $subshell_exit_status
+ fi
fi
fi
@@ -79,7 +87,23 @@ if test -n "$GIT_DIFFTOOL_DIRDIFF"
then
LOCAL="$1"
REMOTE="$2"
+ initialize_merge_tool "$merge_tool"
+ # ignore the error from the above --- run_merge_tool
+ # will diagnose unusable tool by itself
run_merge_tool "$merge_tool" false
+
+ status=$?
+ if test $status -ge 126
+ then
+ # Command not found (127), not executable (126) or
+ # exited via a signal (>= 128).
+ exit $status
+ fi
+
+ if test "$GIT_DIFFTOOL_TRUST_EXIT_CODE" = true
+ then
+ exit $status
+ fi
else
# Launch the merge tool on each path provided by 'git diff'
while test $# -gt 6