summaryrefslogtreecommitdiff
path: root/t/t6006-rev-list-format.sh
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-29 18:13:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-30 03:44:09 (GMT)
commit82b83da8d30fb8d1f04f7dd7ac769ceb6ab431c3 (patch)
treeeb448a1c9ab65a9263e8703ebc5cce631a58c34d /t/t6006-rev-list-format.sh
parentc99ad274b196bc97f22c1c39178784668cb4623d (diff)
downloadgit-82b83da8d30fb8d1f04f7dd7ac769ceb6ab431c3.zip
git-82b83da8d30fb8d1f04f7dd7ac769ceb6ab431c3.tar.gz
git-82b83da8d30fb8d1f04f7dd7ac769ceb6ab431c3.tar.bz2
pretty: avoid adding reset for %C(auto) if output is empty
We emit an escape sequence for resetting color and attribute for %C(auto) to make sure automatic coloring is displayed as intended. Stop doing that if the output strbuf is empty, i.e. when %C(auto) appears at the start of the format string, because then there is no need for a reset and we save a few bytes in the output. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6006-rev-list-format.sh')
-rwxr-xr-xt/t6006-rev-list-format.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index f6020cd..a1dcdb8 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -225,7 +225,7 @@ test_expect_success '%C(auto,...) respects --color=auto (stdout not tty)' '
test_expect_success '%C(auto) respects --color' '
git log --color --format="%C(auto)%H" -1 >actual &&
- printf "\\033[m\\033[33m%s\\033[m\\n" $(git rev-parse HEAD) >expect &&
+ printf "\\033[33m%s\\033[m\\n" $(git rev-parse HEAD) >expect &&
test_cmp expect actual
'