3 test_description
='git branch display tests'
6 test_expect_success
'make commits' '
10 echo content >>file &&
14 test_expect_success
'make branches' '
16 git branch branch-two HEAD^
19 test_expect_success
'make remote branches' '
20 git update-ref refs/remotes/origin/branch-one branch-one
21 git update-ref refs/remotes/origin/branch-two branch-two
22 git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/branch-one
30 test_expect_success
'git branch shows local branches' '
32 test_cmp expect actual
36 origin/HEAD -> origin/branch-one
40 test_expect_success
'git branch -r shows remote branches' '
41 git branch -r >actual &&
42 test_cmp expect actual
49 remotes/origin/HEAD -> origin/branch-one
50 remotes/origin/branch-one
51 remotes/origin/branch-two
53 test_expect_success
'git branch -a shows local and remote branches' '
54 git branch -a >actual &&
55 test_cmp expect actual
63 test_expect_success
'git branch -v shows branch summaries' '
65 awk "{print \$NF}" <tmp >actual &&
66 test_cmp expect actual
75 test_expect_success
'git branch shows detached HEAD properly' '
76 git checkout HEAD^0 &&
78 test_cmp expect actual