Subject: Re: [PATCH v2] difftool: add support for --trust-exit-code

From: Johannes Sixt <[email-masked]>
Date: Sun, 26 Oct 2014 08:31:05 +0100

Am 26.10.2014 um 02:38 schrieb David Aguilar:
> diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
> index 7ef36b9..fdbd768 100755
> --- a/git-difftool--helper.sh
> +++ b/git-difftool--helper.sh
> @@ -62,6 +62,8 @@ launch_merge_tool () {
>  	else
>  		run_merge_tool "$merge_tool"
>  	fi
> +	status=$?
> +	return $status
>  }
>  
>  if ! use_ext_cmd
> @@ -85,5 +87,10 @@ else
>  	do
>  		launch_merge_tool "$1" "$2" "$5"
>  		shift 7
> +		if test "$status" != 0 &&
> +			test "$GIT_DIFFTOOL_TRUST_EXIT_CODE" = true
> +		then
> +			exit $status
> +		fi

If you insert this new code block before the 'shift 7', you can set
status here and do not have to hide it in the helper function.

>  	done
>  fi

-- Hannes