diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-01-10 11:52:53 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-10 11:52:53 -0800 |
commit | 4b51386bbfc5d26e552c3c4be135e31cd2f64b44 (patch) | |
tree | 5bff7a8a4dee06d92dca0a89976248dc7e571918 /builtin/notes.c | |
parent | bc61dbac770923a96e2007c3de4027c5d11c6d41 (diff) | |
parent | f5c39c3268107e1f3def70709d509fd24282832c (diff) | |
download | git-4b51386bbfc5d26e552c3c4be135e31cd2f64b44.tar.gz |
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
Diffstat (limited to 'builtin/notes.c')
-rw-r--r-- | builtin/notes.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/notes.c b/builtin/notes.c index 118db9e455..05d60483e8 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -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); } } |