Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'trailer.c')
-rw-r--r--trailer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/trailer.c b/trailer.c
index d2d01015b1..889b419a4f 100644
--- a/trailer.c
+++ b/trailer.c
@@ -1132,7 +1132,7 @@ static void format_trailer_info(struct strbuf *out,
/* If we want the whole block untouched, we can take the fast path. */
if (!opts->only_trailers && !opts->unfold && !opts->filter &&
- !opts->separator && !opts->value_only) {
+ !opts->separator && !opts->key_only && !opts->value_only) {
strbuf_add(out, info->trailer_start,
info->trailer_end - info->trailer_start);
return;
@@ -1154,8 +1154,11 @@ static void format_trailer_info(struct strbuf *out,
if (opts->separator && out->len != origlen)
strbuf_addbuf(out, opts->separator);
if (!opts->value_only)
- strbuf_addf(out, "%s: ", tok.buf);
- strbuf_addbuf(out, &val);
+ strbuf_addbuf(out, &tok);
+ if (!opts->key_only && !opts->value_only)
+ strbuf_addstr(out, ": ");
+ if (!opts->key_only)
+ strbuf_addbuf(out, &val);
if (!opts->separator)
strbuf_addch(out, '\n');
}