pretty: single return path in %(trailers) handling

No functional change intended. This change may not seem useful on its own, but upcoming commits will do memory allocation in there, and a single return path makes deallocation easier. Signed-off-by: Anders Waldenborg <anders@0x63.nu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Anders Waldenborg committed Jan 28, 2019 at 22:33 UTC 3e3f34781964c225ca199ac50527f3ce6feddb84
1 file changed +3 -1
pretty.c
+3 -1
@@ -1353,6 +1353,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
1353
1354 if (skip_prefix(placeholder, "(trailers", &arg)) {
1355 struct process_trailer_options opts = PROCESS_TRAILER_OPTIONS_INIT;
1356 + size_t ret = 0;
1357
1358 opts.no_divider = 1;
1359
@@ -1366,8 +1367,9 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
1367 }
1368 if (*arg == ')') {
1369 format_trailers_from_commit(sb, msg + c->subject_off, &opts);
1369 - return arg - placeholder + 1;
1370 + ret = arg - placeholder + 1;
1371 }
1372 + return ret;
1373 }
1374
1375 return 0; /* unknown placeholder */