Re: [PATCH] difftool: honor --trust-exit-code for builtin tools
- From
Andreas Schwab <schwab@linux-m68k.org>
- Date
- Nov 16, 2014, 08:18 UTC
- Message-ID
- <m2a93ro8xo.fsf@linux-m68k.org>
- In-Reply-To
- <1416000835-79274-1-git-send-email-davvid@gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 22 quoted lines
> run_merge_tool() was not setting $status, which prevented the
> exit code for builtin tools from being forwarded to the caller.
>
> Capture the exit status and add a test to guarantee the behavior.
>
> Reported-by: Adria Farres <14farresa@gmail.com>
> Signed-off-by: David Aguilar <davvid@gmail.com>
> ---
> git-mergetool--lib.sh | 1 +
> t/t7800-difftool.sh | 5 +++++
> 2 files changed, 6 insertions(+)
>
> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
> index a40d3df..2b66351 100644
> --- a/git-mergetool--lib.sh
> +++ b/git-mergetool--lib.sh
> @@ -221,6 +221,7 @@ run_merge_tool () {
> else
> run_diff_cmd "$1"
> fi
> + status=$?
> return $statusIf you want to return the last exit status at the end of a function you don't need any return at all.
Andreas.
-- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."