git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob 9f2fb785d2f8c8ab6873185baa099506d49b7bce 1144 bytes (raw)
name: t/t3205-branch-color.sh 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
#!/bin/sh

test_description='basic branch output coloring'
. ./test-lib.sh

test_expect_success 'set up some sample branches' '
	test_commit foo &&
	git update-ref refs/remotes/origin/main HEAD &&
	git update-ref refs/heads/other HEAD
'

# choose non-default colors to make sure config
# is taking effect
test_expect_success 'set up some color config' '
	git config color.branch.local blue &&
	git config color.branch.remote yellow &&
	git config color.branch.current cyan
'

test_expect_success 'regular output shows colors' '
	cat >expect <<-\EOF &&
	* <CYAN>main<RESET>
	  <BLUE>other<RESET>
	  <YELLOW>remotes/origin/main<RESET>
	EOF
	git branch --color -a >actual.raw &&
	test_decode_color <actual.raw >actual &&
	test_cmp expect actual
'

test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' '
	oid=$(git rev-parse --short HEAD) &&
	cat >expect <<-EOF &&
	* <CYAN>main               <RESET> $oid foo
	  <BLUE>other              <RESET> $oid foo
	  <YELLOW>remotes/origin/main<RESET> $oid foo
	EOF
	git branch --color -v -a >actual.raw &&
	test_decode_color <actual.raw >actual &&
	test_cmp expect actual
'

test_done

debug log:

solving 9f2fb785d2 ...
found 9f2fb785d2 in https://public-inbox.org/git/0697ef9742af1ab15bd886990bbc0080bad6f41c.1605221039.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/aee29a0528462137af6811d22da50dfcad585b84.1605629548.git.gitgitgadget@gmail.com/
found 289625c464 in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 289625c4646464c412384c6c498383fe7e577da3	t/t3205-branch-color.sh

applying [1/1] https://public-inbox.org/git/0697ef9742af1ab15bd886990bbc0080bad6f41c.1605221039.git.gitgitgadget@gmail.com/
diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh
index 289625c464..9f2fb785d2 100755

Checking patch t/t3205-branch-color.sh...
Applied patch t/t3205-branch-color.sh cleanly.

skipping https://public-inbox.org/git/aee29a0528462137af6811d22da50dfcad585b84.1605629548.git.gitgitgadget@gmail.com/ for 9f2fb785d2
index at:
100755 9f2fb785d2f8c8ab6873185baa099506d49b7bce	t/t3205-branch-color.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).