summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-08-25 14:53:26 +0200
committerJunio C Hamano <gitster@pobox.com>2019-08-26 11:29:43 -0700
commit82f51af3452bb80e2347bb45dba3e1d2f10d0be7 (patch)
tree4147ae94c32d546e726a6b906b3f21bcc451b45f /log-tree.c
parent745f6812895b31c02b29bdfe4ae8e5498f776c26 (diff)
downloadgit-82f51af3452bb80e2347bb45dba3e1d2f10d0be7.tar.gz
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>
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/log-tree.c b/log-tree.c
index 1e56df62a7..109c212224 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -677,9 +677,7 @@ void show_log(struct rev_info *opt)
raw = (opt->commit_format == CMIT_FMT_USERFORMAT);
format_display_notes(&commit->object.oid, &notebuf,
get_log_output_encoding(), raw);
- ctx.notes_message = notebuf.len
- ? strbuf_detach(&notebuf, NULL)
- : xcalloc(1, 1);
+ ctx.notes_message = strbuf_detach(&notebuf, NULL);
}
/*