cli: colorize tag name in "tag list" output

"working_copy tag" wouldn't be needed, but is added for consistency.
This commit is contained in:
Yuya Nishihara 2024-04-26 20:49:58 +09:00
parent 1ce3e9fe44
commit 520b4db919
2 changed files with 9 additions and 0 deletions

View file

@ -29,6 +29,7 @@
"branches" = "magenta"
"local_branches" = "magenta"
"remote_branches" = "magenta"
"tag" = "magenta"
"tags" = "magenta"
"git_refs" = "green"
"git_head" = "green"
@ -55,6 +56,7 @@
"working_copy branches" = "bright magenta"
"working_copy local_branches" = "bright magenta"
"working_copy remote_branches" = "bright magenta"
"working_copy tag" = "bright magenta"
"working_copy tags" = "bright magenta"
"working_copy git_refs" = "bright green"
"working_copy divergent" = "bright red"

View file

@ -48,6 +48,13 @@ fn test_tag_list() {
test_tag2
"###);
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["tag", "list", "--color=always"]),
@r###"
test_tag
test_tag2
"###);
// Test pattern matching.
insta::assert_snapshot!(
test_env.jj_cmd_success(&repo_path, &["tag", "list", "test_tag2"]),