summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/log.c5
-rwxr-xr-xt/t4202-log.sh15
2 files changed, 18 insertions, 2 deletions
diff --git a/builtin/log.c b/builtin/log.c
index a924f56299..93ace0dde7 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -262,7 +262,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
}
}
- if (decoration_style) {
+ if (decoration_style || rev->simplify_by_decoration) {
const struct string_list *config_exclude =
repo_config_get_value_multi(the_repository,
"log.excludeDecoration");
@@ -274,7 +274,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
item->string);
}
- rev->show_decorations = 1;
+ if (decoration_style)
+ rev->show_decorations = 1;
load_ref_decorations(&decoration_filter, decoration_style);
}
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 5f0ae7a785..7a725b9a23 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -974,6 +974,21 @@ test_expect_success 'implied decorate does not override option' '
test_cmp expect actual
'
+test_expect_success 'decorate-refs and simplify-by-decoration without output' '
+ cat >expect <<-\EOF &&
+ side-2
+ initial
+ EOF
+ # Do not just use a --format without %d here; we want to
+ # make sure that we did not accidentally turn on displaying
+ # the decorations, too. And that requires one of the regular
+ # formats.
+ git log --decorate-refs="*side-2" --oneline \
+ --simplify-by-decoration >actual.raw &&
+ sed "s/^[0-9a-f]* //" <actual.raw >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'log.decorate config parsing' '
git log --oneline --decorate=full >expect.full &&
git log --oneline --decorate=short >expect.short &&