Merge branch 'ab/usage-die-message'

Code clean-up to hide vreportf() from public API.

* ab/usage-die-message:
  config API: use get_error_routine(), not vreportf()
  usage.c + gc: add and use a die_message_errno()
  gc: return from cmd_gc(), don't call exit()
  usage.c API users: use die_message() for error() + exit 128
  usage.c API users: use die_message() for "fatal :" + exit 128
  usage.c: add a die_message() routine
This commit is contained in:
Junio C Hamano
2022-01-10 11:52:53 -08:00
9 changed files with 71 additions and 34 deletions

View File

@ -200,11 +200,12 @@ static void prepare_note_data(const struct object_id *object, struct note_data *
static void write_note_data(struct note_data *d, struct object_id *oid)
{
if (write_object_file(d->buf.buf, d->buf.len, blob_type, oid)) {
error(_("unable to write note object"));
int status = die_message(_("unable to write note object"));
if (d->edit_path)
error(_("the note contents have been left in %s"),
d->edit_path);
exit(128);
die_message(_("the note contents have been left in %s"),
d->edit_path);
exit(status);
}
}