3 test_description
='make sure bare branches show up'
10 set -- $
(git
-C "${1:-.}" count-objects
) || die git count-objects failed
11 test z
"${1%%[!0-9]*}" != z || die git count-objects returned nothing
17 test_expect_success
'setup r0 (contains empty blob and tree)' '
18 test_create_repo r0 && cd r0 &&
19 tg_test_create_branches <<-EOT &&
30 git checkout -f t/begin &&
32 git checkout -f t/branch &&
34 git checkout -f boo &&
35 test_commit "boo boo" &&
36 git checkout --orphan unborn &&
37 git read-tree --empty &&
41 test_expect_success
'setup r1 (does not contain empty blob or tree)' '
42 test_create_repo r1 && cd r1 &&
43 test_commit initial &&
44 git checkout --orphan barely &&
45 git read-tree --empty &&
47 test_commit bare^commit &&
48 tg_test_create_branches <<-EOT &&
59 git checkout -f t/begin &&
61 git checkout -f t/branch &&
63 git checkout -f boo &&
64 test_commit "boo boo" &&
65 git checkout --orphan unborn &&
66 git read-tree --empty &&
70 test_expect_success
'setup r2 (read-only copy of r1)' '
71 { [ -d r1 ] || die missing setup r1 repo; } &&
72 { [ ! -e r2 ] || chmod -R u+rw r2; } &&
78 # should have same results whether empty blob and tree object are present or not
79 # r2 is a read-only copy of r1 to make things more challenging
81 for repo
in r0 r1 r2
; do
83 test_expect_success
"($repo) "'tg summary --rdeps --heads' '
89 tg -C $repo summary --rdeps --heads > actual &&
90 test_diff expected actual
93 test_expect_success
"($repo) "'tg summary --list' '
99 tg -C $repo summary --list > actual &&
100 test_diff expected actual
103 test_expect_success
"($repo) "'tg summary --verbpse --list' '
104 ocntb="$(obj_count $repo)" &&
106 boo branch boo (bare branch)
107 t/begin [PATCH] start here
108 t/branch [PATCH] use the base
110 tg -C $repo summary --verbose --list > actual.raw &&
111 tab=" " && # a single tab in there
112 < actual.raw tr -s "$tab" " " > actual &&
113 test_diff expected actual &&
114 ocnta="$(obj_count $repo)" &&
115 test $ocntb -eq $ocnta
118 test_expect_success
"($repo) "'tg summary' '
120 * boo branch boo (bare branch)
121 * t/begin [PATCH] start here
122 D t/branch [PATCH] use the base
124 tg -C $repo summary > actual.raw &&
125 tab=" " && # a single tab in there
126 < actual.raw tr -s "$tab" " " > actual &&
127 test_diff expected actual
130 test_expect_success
"($repo) "'tg info --series' '
131 tab=" " && # a single tab in there
133 * t/begin [PATCH] start here
134 boo branch boo (bare branch)
135 t/branch [PATCH] use the base
137 tg -C $repo info --series t/begin > actual.raw &&
138 < actual.raw tr -s "$tab" " " > actual &&
139 test_diff expected actual &&
141 t/begin [PATCH] start here
142 * boo branch boo (bare branch)
143 t/branch [PATCH] use the base
145 tg -C $repo info --series boo > actual.raw &&
146 < actual.raw tr -s "$tab" " " > actual &&
147 test_diff expected actual &&
149 t/begin [PATCH] start here
150 boo branch boo (bare branch)
151 t/branch [PATCH] use the base
153 tg -C $repo info --series t/branch > actual.raw &&
154 < actual.raw tr -s "$tab" " " > actual &&
155 test_diff expected actual