Re: [PATCH 10/10] mergetool: use run_mergetool from git-mergetool-lib
- From
Charles Bailey <charles@hashpling.org>
- Date
- Apr 2, 2009, 20:02 UTC
- Message-ID
- <20090402200235.GB13817@hashpling.org>
- In-Reply-To
- <200904020054.23147.markus.heidelberg@web.de>
On Thu, Apr 02, 2009 at 12:54:22AM +0200, Markus Heidelberg wrote:
Show 11 quoted lines
> David Aguilar, 01.04.2009: > > + present=false > > + base_present && > > + present=true > > + > > + run_mergetool "$merge_tool" "$present" > > + status=$? > > This last line has to be deleted, because the variable 'status' set in > run_mergetool would be overwritten then. In this case the merge will > succeed even if it didn't and the file will be staged.
I think that it would be better if $status stayed as local as possible. If run_mergetool returned the value of $status as its exit code then the function will properly return whether the merge succeeded or not.
This way run_mergetool's clients can just use its exit code, without having to know about a magic $status global variable.
-- Charles Bailey http://ccgi.hashpling.plus.com/blog/