Re: [PATCH 06/19] Change call signature of write_tree_from_memory()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dscho,

On Thu, Jul 25, 2019 at 12:55 PM Johannes Schindelin
<Johannes.Schindelin@xxxxxx> wrote:
>
> Hi Elijah,
>
> On Thu, 25 Jul 2019, Elijah Newren wrote:
>
> > diff --git a/merge-recursive.c b/merge-recursive.c
> > index 7f56cb0ed1..1a3c6ab7f3 100644
> > --- a/merge-recursive.c
> > +++ b/merge-recursive.c
> > [...]
> > @@ -434,11 +434,10 @@ struct tree *write_tree_from_memory(struct merge_options *opt)
> >
> >       if (!cache_tree_fully_valid(istate->cache_tree) &&
> >           cache_tree_update(istate, 0) < 0) {
> > -             err(opt, _("error building trees"));
> > -             return NULL;
> > +             BUG("error building trees");
>
> Hmm. Is it possible that something else than a bug in Git causes this to
> fail?
>
> I wonder, for example, whether a full disk can cause
> `cache_tree_update()` to return a negative value.

Yeah, you're right.  Based on the conversation with Junio, I think I
can modify the write_index_as_tree() function slightly to do what we
need, then call it instead of write_tree_from_memory().  Since
write_index_as_tree() doesn't try to output any error messages but
just returns various error codes, I can then have the caller handle
the output.  So I'll do that instead of this patch and the previous
one.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux