From: Andreas Schwab Date: Sun, 16 Nov 2014 08:18:11 GMT Subject: Re: [PATCH] difftool: honor --trust-exit-code for builtin tools Message-ID: In-Reply-To: <1416000835-79274-1-git-send-email-davvid@gmail.com> David Aguilar writes: > 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 > --- > 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 $status If 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."