Re: [PATCH v2 12/14] sequencer: lib'ify save_head()

2016-08-30 Thread Johannes Schindelin
Hi Junio, On Mon, 29 Aug 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > strbuf_addf(&buf, "%s\n", head); > > if (write_in_full(fd, buf.buf, buf.len) < 0) > > - die_errno(_("Could not write to %s"), git_path_head_file()); > > + return error_errno(_("C

Re: [PATCH v2 12/14] sequencer: lib'ify save_head()

2016-08-29 Thread Junio C Hamano
Johannes Schindelin writes: > strbuf_addf(&buf, "%s\n", head); > if (write_in_full(fd, buf.buf, buf.len) < 0) > - die_errno(_("Could not write to %s"), git_path_head_file()); > + return error_errno(_("Could not write to %s"), > +

[PATCH v2 12/14] sequencer: lib'ify save_head()

2016-08-26 Thread Johannes Schindelin
Instead of dying there, let the caller high up in the callchain notice the error and handle it (by dying, still). The only caller of save_head(), sequencer_pick_revisions() can already return errors, so its caller must be already prepared to handle error returns, and with this step, we make it not