Re: [PATCH 8/9] merge-recursive: switch to returning errors instead of dying
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 1, 2016, 11:14 UTC
- Message-ID
- <alpine.DEB.2.20.1607011310050.12947@virtualbox>
- In-Reply-To
- <xmqq7fd73d6s.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Wed, 29 Jun 2016, Junio C Hamano wrote:
Show 15 quoted lines
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>
> > @@ -743,6 +741,8 @@ static int update_file_flags(struct merge_options *o,
> > int update_cache,
> > int update_wd)
> > ...
> > + ret = error_errno(_("do not know what to do with %06o %s '%s'"),
> > + mode, sha1_to_hex(sha), path);
> > free_buf:
>
> OK, with a few more users of this label, it no longer looks so
> strange to me to have this label here.
>
> At least, match the indentation level to the existing one we see
> below, though?Okay, fixed.
Although I have to say that I do not quite understand the meaning of the one-space indentation, in particular since the later "error_return" label lacks it.
Show 12 quoted lines
> > free(buf);
> > }
> > update_index:
> > [...]
> > @@ -1861,7 +1867,7 @@ static int process_entry(struct merge_options *o,
> > */
> > remove_file(o, 1, path, !a_mode);
> > } else
> > - die(_("Fatal merge failure, shouldn't happen."));
> > + return error(_("Fatal merge failure, shouldn't happen."));
>
> Isn't this BUG()?I guess it is! Fixed.
Ciao, Dscho