Skip to content

Commit adcd4d4

Browse files
avargitster
authored andcommitted
usage.c API users: use die_message() for error() + exit 128
Continue the migration of code that printed a message and exited with 128. In this case the caller used "error()", so we'll be changing the output from "error: " to "fatal: ". This change is intentional and desired. This code is dying, so it should emit "fatal", the only reason it didn't do so was because before the existence of "die_message()" it would have needed to craft its own "fatal: " message. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e081a7c commit adcd4d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

builtin/notes.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ static void prepare_note_data(const struct object_id *object, struct note_data *
201201
static void write_note_data(struct note_data *d, struct object_id *oid)
202202
{
203203
if (write_object_file(d->buf.buf, d->buf.len, blob_type, oid)) {
204-
error(_("unable to write note object"));
204+
int status = die_message(_("unable to write note object"));
205+
205206
if (d->edit_path)
206-
error(_("the note contents have been left in %s"),
207-
d->edit_path);
208-
exit(128);
207+
die_message(_("the note contents have been left in %s"),
208+
d->edit_path);
209+
exit(status);
209210
}
210211
}
211212

0 commit comments

Comments
 (0)