notes.c: use designated initializers for clarity
The "struct note_data d = { 0, 0, NULL, STRBUF_INIT };" style could be replaced with designated initializer for clarity. Signed-off-by: Teng Long <dyroneteng@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Teng Long committed
May 27, 2023 at 15:57 UTC
3d27ae0712d9b1b70464159b448be1d96ac537e8
1 file changed
+2
-2
builtin/notes.c
+2
-2
@@ -405,7 +405,7 @@ static int add(int argc, const char **argv, const char *prefix)
405
struct notes_tree *t;
406
struct object_id object, new_note;
407
const struct object_id *note;
408
- struct note_data d = { 0, 0, NULL, STRBUF_INIT };
408
+ struct note_data d = { .buf = STRBUF_INIT };
409
struct option options[] = {
410
OPT_CALLBACK_F('m', "message", &d, N_("message"),
411
N_("note contents as a string"), PARSE_OPT_NONEG,
@@ -571,7 +571,7 @@ static int append_edit(int argc, const char **argv, const char *prefix)
571
const struct object_id *note;
572
char *logmsg;
573
const char * const *usage;
574
- struct note_data d = { 0, 0, NULL, STRBUF_INIT };
574
+ struct note_data d = { .buf = STRBUF_INIT };
575
struct option options[] = {
576
OPT_CALLBACK_F('m', "message", &d, N_("message"),
577
N_("note contents as a string"), PARSE_OPT_NONEG,