From: Michael J Gruber Date: Tue, 10 Mar 2015 13:53:20 GMT Subject: [PATCHv2 1/2] log-tree: properly reset colors Message-ID: <0b167704d88ed6b7e8f950f0a05dd51b2b9c6406.1425995310.git.git@drmicha.warpmail.net> In-Reply-To: <54FEC8D0.2060304@drmicha.warpmail.net> Except for the separator, all output items reset the color immediately. Do the same for the separator. This affects only cases where setting color A does not override color B, such as when one is forground and one background. Signed-off-by: Michael J Gruber --- log-tree.c | 1 + t/t4207-log-decoration-colors.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/log-tree.c b/log-tree.c index 7f0890e..53bb526 100644 --- a/log-tree.c +++ b/log-tree.c @@ -195,6 +195,7 @@ void format_decorations_extended(struct strbuf *sb, while (decoration) { strbuf_addstr(sb, color_commit); strbuf_addstr(sb, prefix); + strbuf_addstr(sb, color_reset); strbuf_addstr(sb, decorate_get_color(use_color, decoration->type)); if (decoration->type == DECORATION_REF_TAG) strbuf_addstr(sb, "tag: "); diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh index 925f577..6b8ad4f 100755 --- a/t/t4207-log-decoration-colors.sh +++ b/t/t4207-log-decoration-colors.sh @@ -44,15 +44,15 @@ test_expect_success setup ' ' cat >expected <