log-tree: always use return value of strbuf_detach()
strbuf_detach() has been returning a pointer to a buffer even for empty
strbufs since 08ad56f3f0
("strbuf: always return a non-NULL value from
strbuf_detach", 2012-10-18). Use that feature in show_log() instead of
having it handle empty strbufs specially.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
745f681289
commit
82f51af345
@ -677,9 +677,7 @@ void show_log(struct rev_info *opt)
|
|||||||
raw = (opt->commit_format == CMIT_FMT_USERFORMAT);
|
raw = (opt->commit_format == CMIT_FMT_USERFORMAT);
|
||||||
format_display_notes(&commit->object.oid, ¬ebuf,
|
format_display_notes(&commit->object.oid, ¬ebuf,
|
||||||
get_log_output_encoding(), raw);
|
get_log_output_encoding(), raw);
|
||||||
ctx.notes_message = notebuf.len
|
ctx.notes_message = strbuf_detach(¬ebuf, NULL);
|
||||||
? strbuf_detach(¬ebuf, NULL)
|
|
||||||
: xcalloc(1, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user