aboutsummaryrefslogtreecommitdiffstats
path: root/git-difftool--helper.sh
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2014-10-26 18:15:42 -0700
committerJunio C Hamano <gitster@pobox.com>2014-10-28 10:36:57 -0700
commit2b52123fcf840686b69e10807fd0f985ec4167f3 (patch)
tree34420488a17a99b950f100c1a2ac9e2596599480 /git-difftool--helper.sh
parent25098690a0151ba29ec1c728d783366c1899624d (diff)
downloadgit-2b52123fcf840686b69e10807fd0f985ec4167f3.tar.gz
difftool: add support for --trust-exit-code
Teach difftool to exit when a diff tool returns a non-zero exit code when either --trust-exit-code is specified or difftool.trustExitCode is true. Forward exit codes from invoked diff tools to the caller when --trust-exit-code is used. Suggested-by: Adri Farr <14farresa@gmail.com> Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-difftool--helper.sh')
-rwxr-xr-xgit-difftool--helper.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index aca0413c28..d4fb6dfe13 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -85,6 +85,12 @@ else
while test $# -gt 6
do
launch_merge_tool "$1" "$2" "$5"
+ status=$?
+ if test "$status" != 0 &&
+ test "$GIT_DIFFTOOL_TRUST_EXIT_CODE" = true
+ then
+ exit $status
+ fi
shift 7
done
fi