3 test_description='git branch display tests'
6 test_expect_success 'make commits' '
10 echo content >>file &&
14 test_expect_success 'make branches' '
15 git branch branch-one &&
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
35 test_expect_success 'git branch --list shows local branches' '
36 git branch --list >actual &&
37 test_cmp expect actual
41 origin/HEAD -> origin/branch-one
45 test_expect_success 'git branch -r shows remote branches' '
46 git branch -r >actual &&
47 test_cmp expect actual
54 remotes/origin/HEAD -> origin/branch-one
55 remotes/origin/branch-one
56 remotes/origin/branch-two
58 test_expect_success 'git branch -a shows local and remote branches' '
59 git branch -a >actual &&
60 test_cmp expect actual
68 test_expect_success 'git branch -v shows branch summaries' '
70 awk "{print \$NF}" <tmp >actual &&
71 test_cmp expect actual
80 test_expect_success 'git branch shows detached HEAD properly' '
81 git checkout HEAD^0 &&
83 test_i18ncmp expect actual