Blame


1 05118f5a 2021-06-22 stsp #!/bin/sh
2 05118f5a 2021-06-22 stsp #
3 05118f5a 2021-06-22 stsp # Copyright (c) 2021 Stefan Sperling <stsp@openbsd.org>
4 05118f5a 2021-06-22 stsp #
5 05118f5a 2021-06-22 stsp # Permission to use, copy, modify, and distribute this software for any
6 05118f5a 2021-06-22 stsp # purpose with or without fee is hereby granted, provided that the above
7 05118f5a 2021-06-22 stsp # copyright notice and this permission notice appear in all copies.
8 05118f5a 2021-06-22 stsp #
9 05118f5a 2021-06-22 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 05118f5a 2021-06-22 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 05118f5a 2021-06-22 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 05118f5a 2021-06-22 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 05118f5a 2021-06-22 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 05118f5a 2021-06-22 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 05118f5a 2021-06-22 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 05118f5a 2021-06-22 stsp
17 05118f5a 2021-06-22 stsp . ./common.sh
18 05118f5a 2021-06-22 stsp
19 05118f5a 2021-06-22 stsp # disable automatic packing for these tests
20 05118f5a 2021-06-22 stsp export GOT_TEST_PACK=""
21 05118f5a 2021-06-22 stsp
22 05118f5a 2021-06-22 stsp test_pack_all_loose_objects() {
23 05118f5a 2021-06-22 stsp local testroot=`test_init pack_all_loose_objects`
24 05118f5a 2021-06-22 stsp
25 05118f5a 2021-06-22 stsp # tags should also be packed
26 05118f5a 2021-06-22 stsp got tag -r $testroot/repo -m 1.0 1.0 >/dev/null
27 05118f5a 2021-06-22 stsp
28 05118f5a 2021-06-22 stsp # no pack files should exist yet
29 05118f5a 2021-06-22 stsp ls $testroot/repo/.git/objects/pack/ > $testroot/stdout
30 fc414659 2022-04-16 thomas ret=$?
31 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
32 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
33 05118f5a 2021-06-22 stsp return 1
34 05118f5a 2021-06-22 stsp fi
35 05118f5a 2021-06-22 stsp echo -n > $testroot/stdout.expected
36 05118f5a 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
37 fc414659 2022-04-16 thomas ret=$?
38 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
39 05118f5a 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
40 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
41 05118f5a 2021-06-22 stsp return 1
42 05118f5a 2021-06-22 stsp fi
43 05118f5a 2021-06-22 stsp
44 05118f5a 2021-06-22 stsp gotadmin pack -r $testroot/repo > $testroot/stdout
45 fc414659 2022-04-16 thomas ret=$?
46 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
47 05118f5a 2021-06-22 stsp echo "gotadmin pack failed unexpectedly" >&2
48 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
49 05118f5a 2021-06-22 stsp return 1
50 05118f5a 2021-06-22 stsp fi
51 05118f5a 2021-06-22 stsp packname=`grep ^Wrote $testroot/stdout | cut -d ' ' -f2`
52 05118f5a 2021-06-22 stsp gotadmin listpack $testroot/repo/.git/objects/pack/pack-$packname \
53 05118f5a 2021-06-22 stsp > $testroot/stdout
54 05118f5a 2021-06-22 stsp
55 05118f5a 2021-06-22 stsp for d in $testroot/repo/.git/objects/[0-9a-f][0-9a-f]; do
56 05118f5a 2021-06-22 stsp id0=`basename $d`
57 05118f5a 2021-06-22 stsp ret=0
58 05118f5a 2021-06-22 stsp for e in `ls $d`; do
59 05118f5a 2021-06-22 stsp obj_id=${id0}${e}
60 05118f5a 2021-06-22 stsp if grep -q ^$obj_id $testroot/stdout; then
61 05118f5a 2021-06-22 stsp continue
62 05118f5a 2021-06-22 stsp fi
63 05118f5a 2021-06-22 stsp echo "loose object $obj_id was not packed" >&2
64 05118f5a 2021-06-22 stsp ret=1
65 05118f5a 2021-06-22 stsp break
66 05118f5a 2021-06-22 stsp done
67 fc414659 2022-04-16 thomas if [ $ret -eq 1 ]; then
68 05118f5a 2021-06-22 stsp break
69 05118f5a 2021-06-22 stsp fi
70 05118f5a 2021-06-22 stsp done
71 05118f5a 2021-06-22 stsp
72 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
73 05118f5a 2021-06-22 stsp }
74 05118f5a 2021-06-22 stsp
75 05118f5a 2021-06-22 stsp test_pack_exclude() {
76 05118f5a 2021-06-22 stsp local testroot=`test_init pack_exclude`
77 05118f5a 2021-06-22 stsp local commit0=`git_show_head $testroot/repo`
78 05118f5a 2021-06-22 stsp
79 05118f5a 2021-06-22 stsp # no pack files should exist yet
80 05118f5a 2021-06-22 stsp ls $testroot/repo/.git/objects/pack/ > $testroot/stdout
81 fc414659 2022-04-16 thomas ret=$?
82 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
83 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
84 05118f5a 2021-06-22 stsp return 1
85 05118f5a 2021-06-22 stsp fi
86 05118f5a 2021-06-22 stsp echo -n > $testroot/stdout.expected
87 05118f5a 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
88 fc414659 2022-04-16 thomas ret=$?
89 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
90 05118f5a 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
91 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
92 05118f5a 2021-06-22 stsp return 1
93 05118f5a 2021-06-22 stsp fi
94 05118f5a 2021-06-22 stsp
95 05118f5a 2021-06-22 stsp got branch -r $testroot/repo mybranch
96 fc414659 2022-04-16 thomas ret=$?
97 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
98 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
99 05118f5a 2021-06-22 stsp return 1
100 05118f5a 2021-06-22 stsp fi
101 05118f5a 2021-06-22 stsp
102 05118f5a 2021-06-22 stsp got checkout -b mybranch $testroot/repo $testroot/wt > /dev/null
103 fc414659 2022-04-16 thomas ret=$?
104 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
105 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
106 05118f5a 2021-06-22 stsp return 1
107 05118f5a 2021-06-22 stsp fi
108 05118f5a 2021-06-22 stsp
109 05118f5a 2021-06-22 stsp echo a new line >> $testroot/wt/alpha
110 05118f5a 2021-06-22 stsp (cd $testroot/wt && got commit -m "edit alpha" >/dev/null)
111 05118f5a 2021-06-22 stsp
112 05118f5a 2021-06-22 stsp gotadmin pack -r $testroot/repo -x master > $testroot/stdout
113 fc414659 2022-04-16 thomas ret=$?
114 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
115 05118f5a 2021-06-22 stsp echo "gotadmin pack failed unexpectedly" >&2
116 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
117 05118f5a 2021-06-22 stsp return 1
118 05118f5a 2021-06-22 stsp fi
119 05118f5a 2021-06-22 stsp packname=`grep ^Wrote $testroot/stdout | cut -d ' ' -f2`
120 05118f5a 2021-06-22 stsp gotadmin listpack $testroot/repo/.git/objects/pack/pack-$packname \
121 05118f5a 2021-06-22 stsp > $testroot/stdout
122 05118f5a 2021-06-22 stsp
123 05118f5a 2021-06-22 stsp tree0=`got cat -r $testroot/repo $commit0 | grep ^tree | \
124 05118f5a 2021-06-22 stsp cut -d ' ' -f2`
125 05118f5a 2021-06-22 stsp excluded_ids=`got tree -r $testroot/repo -c $commit0 -R -i | \
126 05118f5a 2021-06-22 stsp cut -d ' ' -f 1`
127 05118f5a 2021-06-22 stsp excluded_ids="$excluded_ids $commit0 $tree0"
128 05118f5a 2021-06-22 stsp for id in $excluded_ids; do
129 05118f5a 2021-06-22 stsp ret=0
130 05118f5a 2021-06-22 stsp if grep -q ^$id $testroot/stdout; then
131 05118f5a 2021-06-22 stsp echo "found excluded object $id in pack file" >&2
132 05118f5a 2021-06-22 stsp ret=1
133 05118f5a 2021-06-22 stsp fi
134 fc414659 2022-04-16 thomas if [ $ret -eq 1 ]; then
135 05118f5a 2021-06-22 stsp break
136 05118f5a 2021-06-22 stsp fi
137 05118f5a 2021-06-22 stsp done
138 fc414659 2022-04-16 thomas if [ $ret -eq 1 ]; then
139 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
140 05118f5a 2021-06-22 stsp return 1
141 05118f5a 2021-06-22 stsp fi
142 05118f5a 2021-06-22 stsp
143 05118f5a 2021-06-22 stsp for d in $testroot/repo/.git/objects/[0-9a-f][0-9a-f]; do
144 05118f5a 2021-06-22 stsp id0=`basename $d`
145 05118f5a 2021-06-22 stsp ret=0
146 05118f5a 2021-06-22 stsp for e in `ls $d`; do
147 05118f5a 2021-06-22 stsp obj_id=${id0}${e}
148 05118f5a 2021-06-22 stsp excluded=0
149 05118f5a 2021-06-22 stsp for id in $excluded_ids; do
150 8775a682 2021-07-03 naddy if [ "$obj_id" = "$id" ]; then
151 05118f5a 2021-06-22 stsp excluded=1
152 05118f5a 2021-06-22 stsp break
153 05118f5a 2021-06-22 stsp fi
154 05118f5a 2021-06-22 stsp done
155 8775a682 2021-07-03 naddy if [ "$excluded" = "1" ]; then
156 05118f5a 2021-06-22 stsp continue
157 05118f5a 2021-06-22 stsp fi
158 05118f5a 2021-06-22 stsp if grep -q ^$obj_id $testroot/stdout; then
159 05118f5a 2021-06-22 stsp continue
160 05118f5a 2021-06-22 stsp fi
161 05118f5a 2021-06-22 stsp echo "loose object $obj_id was not packed" >&2
162 05118f5a 2021-06-22 stsp ret=1
163 05118f5a 2021-06-22 stsp break
164 05118f5a 2021-06-22 stsp done
165 fc414659 2022-04-16 thomas if [ $ret -eq 1 ]; then
166 05118f5a 2021-06-22 stsp break
167 05118f5a 2021-06-22 stsp fi
168 05118f5a 2021-06-22 stsp done
169 05118f5a 2021-06-22 stsp
170 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
171 05118f5a 2021-06-22 stsp }
172 05118f5a 2021-06-22 stsp
173 a3a0e34e 2022-04-16 thomas test_pack_exclude_tag() {
174 a3a0e34e 2022-04-16 thomas local testroot=`test_init pack_exclude_tag`
175 a3a0e34e 2022-04-16 thomas local commit0=`git_show_head $testroot/repo`
176 a3a0e34e 2022-04-16 thomas
177 a3a0e34e 2022-04-16 thomas # no pack files should exist yet
178 a3a0e34e 2022-04-16 thomas ls $testroot/repo/.git/objects/pack/ > $testroot/stdout
179 a3a0e34e 2022-04-16 thomas ret=$?
180 a3a0e34e 2022-04-16 thomas if [ $ret -ne 0 ]; then
181 a3a0e34e 2022-04-16 thomas test_done "$testroot" "$ret"
182 a3a0e34e 2022-04-16 thomas return 1
183 a3a0e34e 2022-04-16 thomas fi
184 a3a0e34e 2022-04-16 thomas echo -n > $testroot/stdout.expected
185 a3a0e34e 2022-04-16 thomas cmp -s $testroot/stdout.expected $testroot/stdout
186 a3a0e34e 2022-04-16 thomas ret=$?
187 a3a0e34e 2022-04-16 thomas if [ $ret -ne 0 ]; then
188 a3a0e34e 2022-04-16 thomas diff -u $testroot/stdout.expected $testroot/stdout
189 a3a0e34e 2022-04-16 thomas test_done "$testroot" "$ret"
190 a3a0e34e 2022-04-16 thomas return 1
191 a3a0e34e 2022-04-16 thomas fi
192 a3a0e34e 2022-04-16 thomas
193 a3a0e34e 2022-04-16 thomas got tag -r $testroot/repo -m 1.0 -c master 1.0 > /dev/null
194 a3a0e34e 2022-04-16 thomas ret=$?
195 a3a0e34e 2022-04-16 thomas if [ $ret -ne 0 ]; then
196 a3a0e34e 2022-04-16 thomas test_done "$testroot" "$ret"
197 a3a0e34e 2022-04-16 thomas return 1
198 a3a0e34e 2022-04-16 thomas fi
199 a3a0e34e 2022-04-16 thomas
200 a3a0e34e 2022-04-16 thomas got branch -r $testroot/repo mybranch
201 a3a0e34e 2022-04-16 thomas ret=$?
202 a3a0e34e 2022-04-16 thomas if [ $ret -ne 0 ]; then
203 a3a0e34e 2022-04-16 thomas test_done "$testroot" "$ret"
204 a3a0e34e 2022-04-16 thomas return 1
205 a3a0e34e 2022-04-16 thomas fi
206 a3a0e34e 2022-04-16 thomas
207 a3a0e34e 2022-04-16 thomas got checkout -b mybranch $testroot/repo $testroot/wt > /dev/null
208 a3a0e34e 2022-04-16 thomas ret=$?
209 a3a0e34e 2022-04-16 thomas if [ $ret -ne 0 ]; then
210 a3a0e34e 2022-04-16 thomas test_done "$testroot" "$ret"
211 a3a0e34e 2022-04-16 thomas return 1
212 a3a0e34e 2022-04-16 thomas fi
213 a3a0e34e 2022-04-16 thomas
214 a3a0e34e 2022-04-16 thomas echo a new line >> $testroot/wt/alpha
215 a3a0e34e 2022-04-16 thomas (cd $testroot/wt && got commit -m "edit alpha" >/dev/null)
216 a3a0e34e 2022-04-16 thomas
217 a3a0e34e 2022-04-16 thomas gotadmin pack -r $testroot/repo -x refs/tags/1.0 > $testroot/stdout
218 a3a0e34e 2022-04-16 thomas ret=$?
219 a3a0e34e 2022-04-16 thomas if [ $ret -ne 0 ]; then
220 a3a0e34e 2022-04-16 thomas echo "gotadmin pack failed unexpectedly" >&2
221 a3a0e34e 2022-04-16 thomas test_done "$testroot" "$ret"
222 a3a0e34e 2022-04-16 thomas return 1
223 a3a0e34e 2022-04-16 thomas fi
224 a3a0e34e 2022-04-16 thomas packname=`grep ^Wrote $testroot/stdout | cut -d ' ' -f2`
225 a3a0e34e 2022-04-16 thomas gotadmin listpack $testroot/repo/.git/objects/pack/pack-$packname \
226 a3a0e34e 2022-04-16 thomas > $testroot/stdout
227 a3a0e34e 2022-04-16 thomas
228 a3a0e34e 2022-04-16 thomas tree0=`got cat -r $testroot/repo $commit0 | grep ^tree | \
229 a3a0e34e 2022-04-16 thomas cut -d ' ' -f2`
230 a3a0e34e 2022-04-16 thomas tag0=`got tag -l -r $testroot/repo | grep ^tag | cut -d ' ' -f3`
231 a3a0e34e 2022-04-16 thomas excluded_ids=`got tree -r $testroot/repo -c $commit0 -R -i | \
232 a3a0e34e 2022-04-16 thomas cut -d ' ' -f 1`
233 a3a0e34e 2022-04-16 thomas excluded_ids="$excluded_ids $commit0 $tree0 $tag0"
234 a3a0e34e 2022-04-16 thomas for id in $excluded_ids; do
235 a3a0e34e 2022-04-16 thomas ret=0
236 a3a0e34e 2022-04-16 thomas if grep -q ^$id $testroot/stdout; then
237 a3a0e34e 2022-04-16 thomas echo "found excluded object $id in pack file" >&2
238 a3a0e34e 2022-04-16 thomas ret=1
239 a3a0e34e 2022-04-16 thomas fi
240 a3a0e34e 2022-04-16 thomas if [ $ret -eq 1 ]; then
241 a3a0e34e 2022-04-16 thomas break
242 a3a0e34e 2022-04-16 thomas fi
243 a3a0e34e 2022-04-16 thomas done
244 a3a0e34e 2022-04-16 thomas if [ $ret -eq 1 ]; then
245 a3a0e34e 2022-04-16 thomas test_done "$testroot" "$ret"
246 a3a0e34e 2022-04-16 thomas return 1
247 a3a0e34e 2022-04-16 thomas fi
248 a3a0e34e 2022-04-16 thomas
249 a3a0e34e 2022-04-16 thomas for d in $testroot/repo/.git/objects/[0-9a-f][0-9a-f]; do
250 a3a0e34e 2022-04-16 thomas id0=`basename $d`
251 a3a0e34e 2022-04-16 thomas ret=0
252 a3a0e34e 2022-04-16 thomas for e in `ls $d`; do
253 a3a0e34e 2022-04-16 thomas obj_id=${id0}${e}
254 a3a0e34e 2022-04-16 thomas excluded=0
255 a3a0e34e 2022-04-16 thomas for id in $excluded_ids; do
256 a3a0e34e 2022-04-16 thomas if [ "$obj_id" = "$id" ]; then
257 a3a0e34e 2022-04-16 thomas excluded=1
258 a3a0e34e 2022-04-16 thomas break
259 a3a0e34e 2022-04-16 thomas fi
260 a3a0e34e 2022-04-16 thomas done
261 a3a0e34e 2022-04-16 thomas if [ "$excluded" = "1" ]; then
262 a3a0e34e 2022-04-16 thomas continue
263 a3a0e34e 2022-04-16 thomas fi
264 a3a0e34e 2022-04-16 thomas if grep -q ^$obj_id $testroot/stdout; then
265 a3a0e34e 2022-04-16 thomas continue
266 a3a0e34e 2022-04-16 thomas fi
267 a3a0e34e 2022-04-16 thomas echo "loose object $obj_id was not packed" >&2
268 a3a0e34e 2022-04-16 thomas ret=1
269 a3a0e34e 2022-04-16 thomas break
270 a3a0e34e 2022-04-16 thomas done
271 a3a0e34e 2022-04-16 thomas if [ $ret -eq 1 ]; then
272 a3a0e34e 2022-04-16 thomas break
273 a3a0e34e 2022-04-16 thomas fi
274 a3a0e34e 2022-04-16 thomas done
275 a3a0e34e 2022-04-16 thomas
276 a3a0e34e 2022-04-16 thomas test_done "$testroot" "$ret"
277 a3a0e34e 2022-04-16 thomas }
278 a3a0e34e 2022-04-16 thomas
279 05118f5a 2021-06-22 stsp test_pack_include() {
280 05118f5a 2021-06-22 stsp local testroot=`test_init pack_include`
281 05118f5a 2021-06-22 stsp local commit0=`git_show_head $testroot/repo`
282 05118f5a 2021-06-22 stsp
283 05118f5a 2021-06-22 stsp # no pack files should exist yet
284 05118f5a 2021-06-22 stsp ls $testroot/repo/.git/objects/pack/ > $testroot/stdout
285 fc414659 2022-04-16 thomas ret=$?
286 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
287 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
288 05118f5a 2021-06-22 stsp return 1
289 05118f5a 2021-06-22 stsp fi
290 05118f5a 2021-06-22 stsp echo -n > $testroot/stdout.expected
291 05118f5a 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
292 fc414659 2022-04-16 thomas ret=$?
293 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
294 05118f5a 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
295 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
296 05118f5a 2021-06-22 stsp return 1
297 05118f5a 2021-06-22 stsp fi
298 05118f5a 2021-06-22 stsp
299 05118f5a 2021-06-22 stsp got branch -r $testroot/repo mybranch
300 fc414659 2022-04-16 thomas ret=$?
301 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
302 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
303 05118f5a 2021-06-22 stsp return 1
304 05118f5a 2021-06-22 stsp fi
305 05118f5a 2021-06-22 stsp
306 05118f5a 2021-06-22 stsp got checkout -b mybranch $testroot/repo $testroot/wt > /dev/null
307 fc414659 2022-04-16 thomas ret=$?
308 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
309 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
310 05118f5a 2021-06-22 stsp return 1
311 05118f5a 2021-06-22 stsp fi
312 05118f5a 2021-06-22 stsp
313 05118f5a 2021-06-22 stsp echo a new line >> $testroot/wt/alpha
314 05118f5a 2021-06-22 stsp (cd $testroot/wt && got commit -m "edit alpha" >/dev/null)
315 05118f5a 2021-06-22 stsp local commit1=`git_show_branch_head $testroot/repo mybranch`
316 05118f5a 2021-06-22 stsp
317 05118f5a 2021-06-22 stsp gotadmin pack -r $testroot/repo master > $testroot/stdout
318 fc414659 2022-04-16 thomas ret=$?
319 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
320 05118f5a 2021-06-22 stsp echo "gotadmin pack failed unexpectedly" >&2
321 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
322 05118f5a 2021-06-22 stsp return 1
323 05118f5a 2021-06-22 stsp fi
324 05118f5a 2021-06-22 stsp packname=`grep ^Wrote $testroot/stdout | cut -d ' ' -f2`
325 05118f5a 2021-06-22 stsp gotadmin listpack $testroot/repo/.git/objects/pack/pack-$packname \
326 05118f5a 2021-06-22 stsp > $testroot/stdout
327 05118f5a 2021-06-22 stsp
328 05118f5a 2021-06-22 stsp tree1=`got cat -r $testroot/repo $commit1 | grep ^tree | \
329 05118f5a 2021-06-22 stsp cut -d ' ' -f2`
330 05118f5a 2021-06-22 stsp alpha1=`got tree -r $testroot/repo -i -c $commit1 | \
331 05118f5a 2021-06-22 stsp grep "[0-9a-f] alpha$" | cut -d' ' -f 1`
332 05118f5a 2021-06-22 stsp excluded_ids="$alpha1 $commit1 $tree1"
333 05118f5a 2021-06-22 stsp for id in $excluded_ids; do
334 05118f5a 2021-06-22 stsp ret=0
335 05118f5a 2021-06-22 stsp if grep -q ^$id $testroot/stdout; then
336 05118f5a 2021-06-22 stsp echo "found excluded object $id in pack file" >&2
337 05118f5a 2021-06-22 stsp ret=1
338 05118f5a 2021-06-22 stsp fi
339 fc414659 2022-04-16 thomas if [ $ret -eq 1 ]; then
340 05118f5a 2021-06-22 stsp break
341 05118f5a 2021-06-22 stsp fi
342 05118f5a 2021-06-22 stsp done
343 fc414659 2022-04-16 thomas if [ $ret -eq 1 ]; then
344 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
345 05118f5a 2021-06-22 stsp return 1
346 05118f5a 2021-06-22 stsp fi
347 05118f5a 2021-06-22 stsp
348 05118f5a 2021-06-22 stsp tree0=`got cat -r $testroot/repo $commit0 | grep ^tree | \
349 05118f5a 2021-06-22 stsp cut -d ' ' -f2`
350 05118f5a 2021-06-22 stsp included_ids=`got tree -r $testroot/repo -c $commit0 -R -i | \
351 05118f5a 2021-06-22 stsp cut -d ' ' -f 1`
352 05118f5a 2021-06-22 stsp included_ids="$included_ids $commit0 $tree0"
353 05118f5a 2021-06-22 stsp for obj_id in $included_ids; do
354 05118f5a 2021-06-22 stsp for id in $excluded_ids; do
355 8775a682 2021-07-03 naddy if [ "$obj_id" = "$id" ]; then
356 05118f5a 2021-06-22 stsp excluded=1
357 05118f5a 2021-06-22 stsp break
358 05118f5a 2021-06-22 stsp fi
359 05118f5a 2021-06-22 stsp done
360 8775a682 2021-07-03 naddy if [ "$excluded" = "1" ]; then
361 05118f5a 2021-06-22 stsp continue
362 05118f5a 2021-06-22 stsp fi
363 05118f5a 2021-06-22 stsp if grep -q ^$obj_id $testroot/stdout; then
364 05118f5a 2021-06-22 stsp continue
365 05118f5a 2021-06-22 stsp fi
366 05118f5a 2021-06-22 stsp echo "included object $obj_id was not packed" >&2
367 05118f5a 2021-06-22 stsp ret=1
368 05118f5a 2021-06-22 stsp break
369 05118f5a 2021-06-22 stsp done
370 05118f5a 2021-06-22 stsp
371 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
372 05118f5a 2021-06-22 stsp }
373 05118f5a 2021-06-22 stsp
374 05118f5a 2021-06-22 stsp test_pack_ambiguous_arg() {
375 05118f5a 2021-06-22 stsp local testroot=`test_init pack_ambiguous_arg`
376 05118f5a 2021-06-22 stsp local commit0=`git_show_head $testroot/repo`
377 05118f5a 2021-06-22 stsp
378 05118f5a 2021-06-22 stsp # no pack files should exist yet
379 05118f5a 2021-06-22 stsp ls $testroot/repo/.git/objects/pack/ > $testroot/stdout
380 fc414659 2022-04-16 thomas ret=$?
381 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
382 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
383 05118f5a 2021-06-22 stsp return 1
384 05118f5a 2021-06-22 stsp fi
385 05118f5a 2021-06-22 stsp echo -n > $testroot/stdout.expected
386 05118f5a 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
387 fc414659 2022-04-16 thomas ret=$?
388 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
389 05118f5a 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
390 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
391 05118f5a 2021-06-22 stsp return 1
392 05118f5a 2021-06-22 stsp fi
393 05118f5a 2021-06-22 stsp
394 05118f5a 2021-06-22 stsp got branch -r $testroot/repo mybranch
395 fc414659 2022-04-16 thomas ret=$?
396 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
397 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
398 05118f5a 2021-06-22 stsp return 1
399 05118f5a 2021-06-22 stsp fi
400 05118f5a 2021-06-22 stsp
401 05118f5a 2021-06-22 stsp got checkout -b mybranch $testroot/repo $testroot/wt > /dev/null
402 fc414659 2022-04-16 thomas ret=$?
403 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
404 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
405 05118f5a 2021-06-22 stsp return 1
406 05118f5a 2021-06-22 stsp fi
407 05118f5a 2021-06-22 stsp
408 05118f5a 2021-06-22 stsp echo a new line >> $testroot/wt/alpha
409 05118f5a 2021-06-22 stsp (cd $testroot/wt && got commit -m "edit alpha" >/dev/null)
410 05118f5a 2021-06-22 stsp local commit1=`git_show_branch_head $testroot/repo mybranch`
411 05118f5a 2021-06-22 stsp
412 c8fc6d14 2022-04-16 thomas gotadmin pack -q -r $testroot/repo -x master master 2> $testroot/stderr
413 fc414659 2022-04-16 thomas ret=$?
414 fc414659 2022-04-16 thomas if [ $ret -eq 0 ]; then
415 05118f5a 2021-06-22 stsp echo "gotadmin pack succeeded unexpectedly" >&2
416 05118f5a 2021-06-22 stsp test_done "$testroot" "1"
417 05118f5a 2021-06-22 stsp return 1
418 05118f5a 2021-06-22 stsp fi
419 05118f5a 2021-06-22 stsp
420 05118f5a 2021-06-22 stsp echo "gotadmin: not enough objects to pack" > $testroot/stderr.expected
421 05118f5a 2021-06-22 stsp cmp -s $testroot/stderr.expected $testroot/stderr
422 fc414659 2022-04-16 thomas ret=$?
423 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
424 05118f5a 2021-06-22 stsp diff -u $testroot/stderr.expected $testroot/stderr
425 05118f5a 2021-06-22 stsp fi
426 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
427 05118f5a 2021-06-22 stsp }
428 05118f5a 2021-06-22 stsp
429 05118f5a 2021-06-22 stsp test_pack_loose_only() {
430 05118f5a 2021-06-22 stsp local testroot=`test_init pack_loose_only`
431 05118f5a 2021-06-22 stsp local commit0=`git_show_head $testroot/repo`
432 05118f5a 2021-06-22 stsp
433 05118f5a 2021-06-22 stsp # no pack files should exist yet
434 05118f5a 2021-06-22 stsp ls $testroot/repo/.git/objects/pack/ > $testroot/stdout
435 fc414659 2022-04-16 thomas ret=$?
436 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
437 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
438 05118f5a 2021-06-22 stsp return 1
439 05118f5a 2021-06-22 stsp fi
440 05118f5a 2021-06-22 stsp echo -n > $testroot/stdout.expected
441 05118f5a 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
442 fc414659 2022-04-16 thomas ret=$?
443 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
444 05118f5a 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
445 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
446 05118f5a 2021-06-22 stsp return 1
447 05118f5a 2021-06-22 stsp fi
448 05118f5a 2021-06-22 stsp
449 05118f5a 2021-06-22 stsp got branch -r $testroot/repo mybranch
450 fc414659 2022-04-16 thomas ret=$?
451 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
452 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
453 05118f5a 2021-06-22 stsp return 1
454 05118f5a 2021-06-22 stsp fi
455 05118f5a 2021-06-22 stsp
456 05118f5a 2021-06-22 stsp got checkout -b mybranch $testroot/repo $testroot/wt > /dev/null
457 fc414659 2022-04-16 thomas ret=$?
458 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
459 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
460 05118f5a 2021-06-22 stsp return 1
461 05118f5a 2021-06-22 stsp fi
462 05118f5a 2021-06-22 stsp
463 05118f5a 2021-06-22 stsp echo a new line >> $testroot/wt/alpha
464 05118f5a 2021-06-22 stsp (cd $testroot/wt && got commit -m "edit alpha" >/dev/null)
465 05118f5a 2021-06-22 stsp
466 05118f5a 2021-06-22 stsp # pack objects belonging to the 'master' branch; its objects
467 05118f5a 2021-06-22 stsp # should then be excluded while packing 'mybranch' since they
468 05118f5a 2021-06-22 stsp # are already packed
469 c8fc6d14 2022-04-16 thomas gotadmin pack -q -r $testroot/repo master
470 fc414659 2022-04-16 thomas ret=$?
471 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
472 05118f5a 2021-06-22 stsp echo "gotadmin pack failed unexpectedly" >&2
473 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
474 05118f5a 2021-06-22 stsp return 1
475 05118f5a 2021-06-22 stsp fi
476 05118f5a 2021-06-22 stsp
477 05118f5a 2021-06-22 stsp gotadmin pack -r $testroot/repo mybranch > $testroot/stdout
478 fc414659 2022-04-16 thomas ret=$?
479 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
480 05118f5a 2021-06-22 stsp echo "gotadmin pack failed unexpectedly" >&2
481 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
482 05118f5a 2021-06-22 stsp return 1
483 05118f5a 2021-06-22 stsp fi
484 05118f5a 2021-06-22 stsp packname=`grep ^Wrote $testroot/stdout | cut -d ' ' -f2`
485 05118f5a 2021-06-22 stsp gotadmin listpack $testroot/repo/.git/objects/pack/pack-$packname \
486 05118f5a 2021-06-22 stsp > $testroot/stdout
487 05118f5a 2021-06-22 stsp
488 05118f5a 2021-06-22 stsp tree0=`got cat -r $testroot/repo $commit0 | grep ^tree | \
489 05118f5a 2021-06-22 stsp cut -d ' ' -f2`
490 05118f5a 2021-06-22 stsp excluded_ids=`got tree -r $testroot/repo -c $commit0 -R -i | \
491 05118f5a 2021-06-22 stsp cut -d ' ' -f 1`
492 05118f5a 2021-06-22 stsp excluded_ids="$excluded_ids $commit0 $tree0"
493 05118f5a 2021-06-22 stsp for id in $excluded_ids; do
494 05118f5a 2021-06-22 stsp ret=0
495 05118f5a 2021-06-22 stsp if grep -q ^$id $testroot/stdout; then
496 05118f5a 2021-06-22 stsp echo "found excluded object $id in pack file" >&2
497 05118f5a 2021-06-22 stsp ret=1
498 05118f5a 2021-06-22 stsp fi
499 fc414659 2022-04-16 thomas if [ $ret -eq 1 ]; then
500 05118f5a 2021-06-22 stsp break
501 05118f5a 2021-06-22 stsp fi
502 05118f5a 2021-06-22 stsp done
503 fc414659 2022-04-16 thomas if [ $ret -eq 1 ]; then
504 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
505 05118f5a 2021-06-22 stsp return 1
506 05118f5a 2021-06-22 stsp fi
507 05118f5a 2021-06-22 stsp
508 05118f5a 2021-06-22 stsp for d in $testroot/repo/.git/objects/[0-9a-f][0-9a-f]; do
509 05118f5a 2021-06-22 stsp id0=`basename $d`
510 05118f5a 2021-06-22 stsp ret=0
511 05118f5a 2021-06-22 stsp for e in `ls $d`; do
512 05118f5a 2021-06-22 stsp obj_id=${id0}${e}
513 05118f5a 2021-06-22 stsp excluded=0
514 05118f5a 2021-06-22 stsp for id in $excluded_ids; do
515 8775a682 2021-07-03 naddy if [ "$obj_id" = "$id" ]; then
516 05118f5a 2021-06-22 stsp excluded=1
517 05118f5a 2021-06-22 stsp break
518 05118f5a 2021-06-22 stsp fi
519 05118f5a 2021-06-22 stsp done
520 8775a682 2021-07-03 naddy if [ "$excluded" = "1" ]; then
521 05118f5a 2021-06-22 stsp continue
522 05118f5a 2021-06-22 stsp fi
523 05118f5a 2021-06-22 stsp if grep -q ^$obj_id $testroot/stdout; then
524 05118f5a 2021-06-22 stsp continue
525 05118f5a 2021-06-22 stsp fi
526 05118f5a 2021-06-22 stsp echo "loose object $obj_id was not packed" >&2
527 05118f5a 2021-06-22 stsp ret=1
528 05118f5a 2021-06-22 stsp break
529 05118f5a 2021-06-22 stsp done
530 fc414659 2022-04-16 thomas if [ $ret -eq 1 ]; then
531 05118f5a 2021-06-22 stsp break
532 05118f5a 2021-06-22 stsp fi
533 05118f5a 2021-06-22 stsp done
534 05118f5a 2021-06-22 stsp
535 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
536 05118f5a 2021-06-22 stsp }
537 05118f5a 2021-06-22 stsp
538 05118f5a 2021-06-22 stsp test_pack_all_objects() {
539 05118f5a 2021-06-22 stsp local testroot=`test_init pack_all_objects`
540 05118f5a 2021-06-22 stsp local commit0=`git_show_head $testroot/repo`
541 05118f5a 2021-06-22 stsp
542 05118f5a 2021-06-22 stsp # no pack files should exist yet
543 05118f5a 2021-06-22 stsp ls $testroot/repo/.git/objects/pack/ > $testroot/stdout
544 fc414659 2022-04-16 thomas ret=$?
545 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
546 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
547 05118f5a 2021-06-22 stsp return 1
548 05118f5a 2021-06-22 stsp fi
549 05118f5a 2021-06-22 stsp echo -n > $testroot/stdout.expected
550 05118f5a 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
551 fc414659 2022-04-16 thomas ret=$?
552 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
553 05118f5a 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
554 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
555 05118f5a 2021-06-22 stsp return 1
556 05118f5a 2021-06-22 stsp fi
557 05118f5a 2021-06-22 stsp
558 05118f5a 2021-06-22 stsp got branch -r $testroot/repo mybranch
559 fc414659 2022-04-16 thomas ret=$?
560 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
561 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
562 05118f5a 2021-06-22 stsp return 1
563 05118f5a 2021-06-22 stsp fi
564 05118f5a 2021-06-22 stsp
565 05118f5a 2021-06-22 stsp got checkout -b mybranch $testroot/repo $testroot/wt > /dev/null
566 fc414659 2022-04-16 thomas ret=$?
567 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
568 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
569 05118f5a 2021-06-22 stsp return 1
570 05118f5a 2021-06-22 stsp fi
571 05118f5a 2021-06-22 stsp
572 05118f5a 2021-06-22 stsp echo a new line >> $testroot/wt/alpha
573 05118f5a 2021-06-22 stsp (cd $testroot/wt && got commit -m "edit alpha" >/dev/null)
574 05118f5a 2021-06-22 stsp
575 05118f5a 2021-06-22 stsp # pack objects belonging to the 'master' branch
576 c8fc6d14 2022-04-16 thomas gotadmin pack -q -r $testroot/repo master
577 fc414659 2022-04-16 thomas ret=$?
578 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
579 05118f5a 2021-06-22 stsp echo "gotadmin pack failed unexpectedly" >&2
580 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
581 05118f5a 2021-06-22 stsp return 1
582 05118f5a 2021-06-22 stsp fi
583 05118f5a 2021-06-22 stsp
584 05118f5a 2021-06-22 stsp # pack mybranch, including already packed objects on the
585 05118f5a 2021-06-22 stsp # 'master' branch which are reachable from mybranch
586 05118f5a 2021-06-22 stsp gotadmin pack -r $testroot/repo -a mybranch > $testroot/stdout
587 fc414659 2022-04-16 thomas ret=$?
588 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
589 05118f5a 2021-06-22 stsp echo "gotadmin pack failed unexpectedly" >&2
590 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
591 05118f5a 2021-06-22 stsp return 1
592 05118f5a 2021-06-22 stsp fi
593 05118f5a 2021-06-22 stsp packname=`grep ^Wrote $testroot/stdout | cut -d ' ' -f2`
594 05118f5a 2021-06-22 stsp gotadmin listpack $testroot/repo/.git/objects/pack/pack-$packname \
595 05118f5a 2021-06-22 stsp > $testroot/stdout
596 05118f5a 2021-06-22 stsp
597 05118f5a 2021-06-22 stsp for d in $testroot/repo/.git/objects/[0-9a-f][0-9a-f]; do
598 05118f5a 2021-06-22 stsp id0=`basename $d`
599 05118f5a 2021-06-22 stsp ret=0
600 05118f5a 2021-06-22 stsp for e in `ls $d`; do
601 05118f5a 2021-06-22 stsp obj_id=${id0}${e}
602 05118f5a 2021-06-22 stsp if grep -q ^$obj_id $testroot/stdout; then
603 05118f5a 2021-06-22 stsp continue
604 05118f5a 2021-06-22 stsp fi
605 05118f5a 2021-06-22 stsp echo "loose object $obj_id was not packed" >&2
606 05118f5a 2021-06-22 stsp ret=1
607 05118f5a 2021-06-22 stsp break
608 05118f5a 2021-06-22 stsp done
609 fc414659 2022-04-16 thomas if [ $ret -eq 1 ]; then
610 05118f5a 2021-06-22 stsp break
611 05118f5a 2021-06-22 stsp fi
612 05118f5a 2021-06-22 stsp done
613 05118f5a 2021-06-22 stsp
614 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
615 05118f5a 2021-06-22 stsp }
616 05118f5a 2021-06-22 stsp
617 05118f5a 2021-06-22 stsp test_pack_bad_ref() {
618 05118f5a 2021-06-22 stsp local testroot=`test_init pack_bad_ref`
619 05118f5a 2021-06-22 stsp local commit0=`git_show_head $testroot/repo`
620 05118f5a 2021-06-22 stsp
621 05118f5a 2021-06-22 stsp # no pack files should exist yet
622 05118f5a 2021-06-22 stsp ls $testroot/repo/.git/objects/pack/ > $testroot/stdout
623 fc414659 2022-04-16 thomas ret=$?
624 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
625 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
626 05118f5a 2021-06-22 stsp return 1
627 05118f5a 2021-06-22 stsp fi
628 05118f5a 2021-06-22 stsp echo -n > $testroot/stdout.expected
629 05118f5a 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
630 fc414659 2022-04-16 thomas ret=$?
631 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
632 05118f5a 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
633 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
634 05118f5a 2021-06-22 stsp return 1
635 05118f5a 2021-06-22 stsp fi
636 05118f5a 2021-06-22 stsp
637 05118f5a 2021-06-22 stsp got branch -r $testroot/repo mybranch
638 fc414659 2022-04-16 thomas ret=$?
639 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
640 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
641 05118f5a 2021-06-22 stsp return 1
642 05118f5a 2021-06-22 stsp fi
643 05118f5a 2021-06-22 stsp
644 05118f5a 2021-06-22 stsp got checkout -b mybranch $testroot/repo $testroot/wt > /dev/null
645 fc414659 2022-04-16 thomas ret=$?
646 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
647 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
648 05118f5a 2021-06-22 stsp return 1
649 05118f5a 2021-06-22 stsp fi
650 05118f5a 2021-06-22 stsp
651 05118f5a 2021-06-22 stsp gotadmin pack -r $testroot/repo refs/got/worktree/ \
652 05118f5a 2021-06-22 stsp > $testroot/stdout 2> $testroot/stderr
653 fc414659 2022-04-16 thomas ret=$?
654 fc414659 2022-04-16 thomas if [ $ret -eq 0 ]; then
655 05118f5a 2021-06-22 stsp echo "gotadmin pack succeeded unexpectedly" >&2
656 05118f5a 2021-06-22 stsp test_done "$testroot" "1"
657 05118f5a 2021-06-22 stsp return 1
658 05118f5a 2021-06-22 stsp fi
659 05118f5a 2021-06-22 stsp
660 05118f5a 2021-06-22 stsp echo -n > $testroot/stdout.expected
661 05118f5a 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
662 fc414659 2022-04-16 thomas ret=$?
663 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
664 05118f5a 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
665 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
666 05118f5a 2021-06-22 stsp return 1
667 05118f5a 2021-06-22 stsp fi
668 05118f5a 2021-06-22 stsp
669 05118f5a 2021-06-22 stsp echo "gotadmin: not enough objects to pack" > $testroot/stderr.expected
670 05118f5a 2021-06-22 stsp cmp -s $testroot/stderr.expected $testroot/stderr
671 fc414659 2022-04-16 thomas ret=$?
672 fc414659 2022-04-16 thomas if [ $ret -ne 0 ]; then
673 05118f5a 2021-06-22 stsp diff -u $testroot/stderr.expected $testroot/stderr
674 05118f5a 2021-06-22 stsp fi
675 05118f5a 2021-06-22 stsp test_done "$testroot" "$ret"
676 05118f5a 2021-06-22 stsp }
677 05118f5a 2021-06-22 stsp
678 05118f5a 2021-06-22 stsp test_parseargs "$@"
679 05118f5a 2021-06-22 stsp run_test test_pack_all_loose_objects
680 05118f5a 2021-06-22 stsp run_test test_pack_exclude
681 a3a0e34e 2022-04-16 thomas run_test test_pack_exclude_tag
682 05118f5a 2021-06-22 stsp run_test test_pack_include
683 05118f5a 2021-06-22 stsp run_test test_pack_ambiguous_arg
684 05118f5a 2021-06-22 stsp run_test test_pack_loose_only
685 05118f5a 2021-06-22 stsp run_test test_pack_all_objects
686 05118f5a 2021-06-22 stsp run_test test_pack_bad_ref