fetch: allow adding a filter after initial clone
[git] / t / t0410-partial-clone.sh
1 #!/bin/sh
2
3 test_description='partial clone'
4
5 . ./test-lib.sh
6
7 delete_object () {
8         rm $1/.git/objects/$(echo $2 | sed -e 's|^..|&/|')
9 }
10
11 pack_as_from_promisor () {
12         HASH=$(git -C repo pack-objects .git/objects/pack/pack) &&
13         >repo/.git/objects/pack/pack-$HASH.promisor &&
14         echo $HASH
15 }
16
17 promise_and_delete () {
18         HASH=$(git -C repo rev-parse "$1") &&
19         git -C repo tag -a -m message my_annotated_tag "$HASH" &&
20         git -C repo rev-parse my_annotated_tag | pack_as_from_promisor &&
21         # tag -d prints a message to stdout, so redirect it
22         git -C repo tag -d my_annotated_tag >/dev/null &&
23         delete_object repo "$HASH"
24 }
25
26 test_expect_success 'extensions.partialclone without filter' '
27         test_create_repo server &&
28         git clone --filter="blob:none" "file://$(pwd)/server" client &&
29         git -C client config --unset remote.origin.partialclonefilter &&
30         git -C client fetch origin
31 '
32
33 test_expect_success 'convert shallow clone to partial clone' '
34         rm -fr server client &&
35         test_create_repo server &&
36         test_commit -C server my_commit 1 &&
37         test_commit -C server my_commit2 1 &&
38         git clone --depth=1 "file://$(pwd)/server" client &&
39         git -C client fetch --unshallow --filter="blob:none" &&
40         test_cmp_config -C client true remote.origin.promisor &&
41         test_cmp_config -C client blob:none remote.origin.partialclonefilter &&
42         test_cmp_config -C client 1 core.repositoryformatversion
43 '
44
45 test_expect_success 'missing reflog object, but promised by a commit, passes fsck' '
46         rm -rf repo &&
47         test_create_repo repo &&
48         test_commit -C repo my_commit &&
49
50         A=$(git -C repo commit-tree -m a HEAD^{tree}) &&
51         C=$(git -C repo commit-tree -m c -p $A HEAD^{tree}) &&
52
53         # Reference $A only from reflog, and delete it
54         git -C repo branch my_branch "$A" &&
55         git -C repo branch -f my_branch my_commit &&
56         delete_object repo "$A" &&
57
58         # State that we got $C, which refers to $A, from promisor
59         printf "$C\n" | pack_as_from_promisor &&
60
61         # Normally, it fails
62         test_must_fail git -C repo fsck &&
63
64         # But with the extension, it succeeds
65         git -C repo config core.repositoryformatversion 1 &&
66         git -C repo config extensions.partialclone "arbitrary string" &&
67         git -C repo fsck
68 '
69
70 test_expect_success 'missing reflog object, but promised by a tag, passes fsck' '
71         rm -rf repo &&
72         test_create_repo repo &&
73         test_commit -C repo my_commit &&
74
75         A=$(git -C repo commit-tree -m a HEAD^{tree}) &&
76         git -C repo tag -a -m d my_tag_name $A &&
77         T=$(git -C repo rev-parse my_tag_name) &&
78         git -C repo tag -d my_tag_name &&
79
80         # Reference $A only from reflog, and delete it
81         git -C repo branch my_branch "$A" &&
82         git -C repo branch -f my_branch my_commit &&
83         delete_object repo "$A" &&
84
85         # State that we got $T, which refers to $A, from promisor
86         printf "$T\n" | pack_as_from_promisor &&
87
88         git -C repo config core.repositoryformatversion 1 &&
89         git -C repo config extensions.partialclone "arbitrary string" &&
90         git -C repo fsck
91 '
92
93 test_expect_success 'missing reflog object alone fails fsck, even with extension set' '
94         rm -rf repo &&
95         test_create_repo repo &&
96         test_commit -C repo my_commit &&
97
98         A=$(git -C repo commit-tree -m a HEAD^{tree}) &&
99         B=$(git -C repo commit-tree -m b HEAD^{tree}) &&
100
101         # Reference $A only from reflog, and delete it
102         git -C repo branch my_branch "$A" &&
103         git -C repo branch -f my_branch my_commit &&
104         delete_object repo "$A" &&
105
106         git -C repo config core.repositoryformatversion 1 &&
107         git -C repo config extensions.partialclone "arbitrary string" &&
108         test_must_fail git -C repo fsck
109 '
110
111 test_expect_success 'missing ref object, but promised, passes fsck' '
112         rm -rf repo &&
113         test_create_repo repo &&
114         test_commit -C repo my_commit &&
115
116         A=$(git -C repo commit-tree -m a HEAD^{tree}) &&
117
118         # Reference $A only from ref
119         git -C repo branch my_branch "$A" &&
120         promise_and_delete "$A" &&
121
122         git -C repo config core.repositoryformatversion 1 &&
123         git -C repo config extensions.partialclone "arbitrary string" &&
124         git -C repo fsck
125 '
126
127 test_expect_success 'missing object, but promised, passes fsck' '
128         rm -rf repo &&
129         test_create_repo repo &&
130         test_commit -C repo 1 &&
131         test_commit -C repo 2 &&
132         test_commit -C repo 3 &&
133         git -C repo tag -a annotated_tag -m "annotated tag" &&
134
135         C=$(git -C repo rev-parse 1) &&
136         T=$(git -C repo rev-parse 2^{tree}) &&
137         B=$(git hash-object repo/3.t) &&
138         AT=$(git -C repo rev-parse annotated_tag) &&
139
140         promise_and_delete "$C" &&
141         promise_and_delete "$T" &&
142         promise_and_delete "$B" &&
143         promise_and_delete "$AT" &&
144
145         git -C repo config core.repositoryformatversion 1 &&
146         git -C repo config extensions.partialclone "arbitrary string" &&
147         git -C repo fsck
148 '
149
150 test_expect_success 'missing CLI object, but promised, passes fsck' '
151         rm -rf repo &&
152         test_create_repo repo &&
153         test_commit -C repo my_commit &&
154
155         A=$(git -C repo commit-tree -m a HEAD^{tree}) &&
156         promise_and_delete "$A" &&
157
158         git -C repo config core.repositoryformatversion 1 &&
159         git -C repo config extensions.partialclone "arbitrary string" &&
160         git -C repo fsck "$A"
161 '
162
163 test_expect_success 'fetching of missing objects' '
164         rm -rf repo &&
165         test_create_repo server &&
166         test_commit -C server foo &&
167         git -C server repack -a -d --write-bitmap-index &&
168
169         git clone "file://$(pwd)/server" repo &&
170         HASH=$(git -C repo rev-parse foo) &&
171         rm -rf repo/.git/objects/* &&
172
173         git -C repo config core.repositoryformatversion 1 &&
174         git -C repo config extensions.partialclone "origin" &&
175         git -C repo cat-file -p "$HASH" &&
176
177         # Ensure that the .promisor file is written, and check that its
178         # associated packfile contains the object
179         ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
180         test_line_count = 1 promisorlist &&
181         IDX=$(sed "s/promisor$/idx/" promisorlist) &&
182         git verify-pack --verbose "$IDX" >out &&
183         grep "$HASH" out
184 '
185
186 test_expect_success 'fetching of missing objects works with ref-in-want enabled' '
187         # ref-in-want requires protocol version 2
188         git -C server config protocol.version 2 &&
189         git -C server config uploadpack.allowrefinwant 1 &&
190         git -C repo config protocol.version 2 &&
191
192         rm -rf repo/.git/objects/* &&
193         rm -f trace &&
194         GIT_TRACE_PACKET="$(pwd)/trace" git -C repo cat-file -p "$HASH" &&
195         grep "git< fetch=.*ref-in-want" trace
196 '
197
198 test_expect_success 'fetching of missing objects from another promisor remote' '
199         git clone "file://$(pwd)/server" server2 &&
200         test_commit -C server2 bar &&
201         git -C server2 repack -a -d --write-bitmap-index &&
202         HASH2=$(git -C server2 rev-parse bar) &&
203
204         git -C repo remote add server2 "file://$(pwd)/server2" &&
205         git -C repo config remote.server2.promisor true &&
206         git -C repo cat-file -p "$HASH2" &&
207
208         git -C repo fetch server2 &&
209         rm -rf repo/.git/objects/* &&
210         git -C repo cat-file -p "$HASH2" &&
211
212         # Ensure that the .promisor file is written, and check that its
213         # associated packfile contains the object
214         ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
215         test_line_count = 1 promisorlist &&
216         IDX=$(sed "s/promisor$/idx/" promisorlist) &&
217         git verify-pack --verbose "$IDX" >out &&
218         grep "$HASH2" out
219 '
220
221 test_expect_success 'fetching of missing objects configures a promisor remote' '
222         git clone "file://$(pwd)/server" server3 &&
223         test_commit -C server3 baz &&
224         git -C server3 repack -a -d --write-bitmap-index &&
225         HASH3=$(git -C server3 rev-parse baz) &&
226         git -C server3 config uploadpack.allowfilter 1 &&
227
228         rm repo/.git/objects/pack/pack-*.promisor &&
229
230         git -C repo remote add server3 "file://$(pwd)/server3" &&
231         git -C repo fetch --filter="blob:none" server3 $HASH3 &&
232
233         test_cmp_config -C repo true remote.server3.promisor &&
234
235         # Ensure that the .promisor file is written, and check that its
236         # associated packfile contains the object
237         ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
238         test_line_count = 1 promisorlist &&
239         IDX=$(sed "s/promisor$/idx/" promisorlist) &&
240         git verify-pack --verbose "$IDX" >out &&
241         grep "$HASH3" out
242 '
243
244 test_expect_success 'fetching of missing blobs works' '
245         rm -rf server server2 repo &&
246         rm -rf server server3 repo &&
247         test_create_repo server &&
248         test_commit -C server foo &&
249         git -C server repack -a -d --write-bitmap-index &&
250
251         git clone "file://$(pwd)/server" repo &&
252         git hash-object repo/foo.t >blobhash &&
253         rm -rf repo/.git/objects/* &&
254
255         git -C server config uploadpack.allowanysha1inwant 1 &&
256         git -C server config uploadpack.allowfilter 1 &&
257         git -C repo config core.repositoryformatversion 1 &&
258         git -C repo config extensions.partialclone "origin" &&
259
260         git -C repo cat-file -p $(cat blobhash)
261 '
262
263 test_expect_success 'fetching of missing trees does not fetch blobs' '
264         rm -rf server repo &&
265         test_create_repo server &&
266         test_commit -C server foo &&
267         git -C server repack -a -d --write-bitmap-index &&
268
269         git clone "file://$(pwd)/server" repo &&
270         git -C repo rev-parse foo^{tree} >treehash &&
271         git hash-object repo/foo.t >blobhash &&
272         rm -rf repo/.git/objects/* &&
273
274         git -C server config uploadpack.allowanysha1inwant 1 &&
275         git -C server config uploadpack.allowfilter 1 &&
276         git -C repo config core.repositoryformatversion 1 &&
277         git -C repo config extensions.partialclone "origin" &&
278         git -C repo cat-file -p $(cat treehash) &&
279
280         # Ensure that the tree, but not the blob, is fetched
281         git -C repo rev-list --objects --missing=print $(cat treehash) >objects &&
282         grep "^$(cat treehash)" objects &&
283         grep "^[?]$(cat blobhash)" objects
284 '
285
286 test_expect_success 'rev-list stops traversal at missing and promised commit' '
287         rm -rf repo &&
288         test_create_repo repo &&
289         test_commit -C repo foo &&
290         test_commit -C repo bar &&
291
292         FOO=$(git -C repo rev-parse foo) &&
293         promise_and_delete "$FOO" &&
294
295         git -C repo config core.repositoryformatversion 1 &&
296         git -C repo config extensions.partialclone "arbitrary string" &&
297         GIT_TEST_COMMIT_GRAPH=0 git -C repo -c core.commitGraph=false rev-list --exclude-promisor-objects --objects bar >out &&
298         grep $(git -C repo rev-parse bar) out &&
299         ! grep $FOO out
300 '
301
302 test_expect_success 'missing tree objects with --missing=allow-promisor and --exclude-promisor-objects' '
303         rm -rf repo &&
304         test_create_repo repo &&
305         test_commit -C repo foo &&
306         test_commit -C repo bar &&
307         test_commit -C repo baz &&
308
309         promise_and_delete $(git -C repo rev-parse bar^{tree}) &&
310         promise_and_delete $(git -C repo rev-parse foo^{tree}) &&
311
312         git -C repo config core.repositoryformatversion 1 &&
313         git -C repo config extensions.partialclone "arbitrary string" &&
314
315         git -C repo rev-list --missing=allow-promisor --objects HEAD >objs 2>rev_list_err &&
316         test_must_be_empty rev_list_err &&
317         # 3 commits, 3 blobs, and 1 tree
318         test_line_count = 7 objs &&
319
320         # Do the same for --exclude-promisor-objects, but with all trees gone.
321         promise_and_delete $(git -C repo rev-parse baz^{tree}) &&
322         git -C repo rev-list --exclude-promisor-objects --objects HEAD >objs 2>rev_list_err &&
323         test_must_be_empty rev_list_err &&
324         # 3 commits, no blobs or trees
325         test_line_count = 3 objs
326 '
327
328 test_expect_success 'missing non-root tree object and rev-list' '
329         rm -rf repo &&
330         test_create_repo repo &&
331         mkdir repo/dir &&
332         echo foo >repo/dir/foo &&
333         git -C repo add dir/foo &&
334         git -C repo commit -m "commit dir/foo" &&
335
336         promise_and_delete $(git -C repo rev-parse HEAD:dir) &&
337
338         git -C repo config core.repositoryformatversion 1 &&
339         git -C repo config extensions.partialclone "arbitrary string" &&
340
341         git -C repo rev-list --missing=allow-any --objects HEAD >objs 2>rev_list_err &&
342         test_must_be_empty rev_list_err &&
343         # 1 commit and 1 tree
344         test_line_count = 2 objs
345 '
346
347 test_expect_success 'rev-list stops traversal at missing and promised tree' '
348         rm -rf repo &&
349         test_create_repo repo &&
350         test_commit -C repo foo &&
351         mkdir repo/a_dir &&
352         echo something >repo/a_dir/something &&
353         git -C repo add a_dir/something &&
354         git -C repo commit -m bar &&
355
356         # foo^{tree} (tree referenced from commit)
357         TREE=$(git -C repo rev-parse foo^{tree}) &&
358
359         # a tree referenced by HEAD^{tree} (tree referenced from tree)
360         TREE2=$(git -C repo ls-tree HEAD^{tree} | grep " tree " | head -1 | cut -b13-52) &&
361
362         promise_and_delete "$TREE" &&
363         promise_and_delete "$TREE2" &&
364
365         git -C repo config core.repositoryformatversion 1 &&
366         git -C repo config extensions.partialclone "arbitrary string" &&
367         git -C repo rev-list --exclude-promisor-objects --objects HEAD >out &&
368         grep $(git -C repo rev-parse foo) out &&
369         ! grep $TREE out &&
370         grep $(git -C repo rev-parse HEAD) out &&
371         ! grep $TREE2 out
372 '
373
374 test_expect_success 'rev-list stops traversal at missing and promised blob' '
375         rm -rf repo &&
376         test_create_repo repo &&
377         echo something >repo/something &&
378         git -C repo add something &&
379         git -C repo commit -m foo &&
380
381         BLOB=$(git -C repo hash-object -w something) &&
382         promise_and_delete "$BLOB" &&
383
384         git -C repo config core.repositoryformatversion 1 &&
385         git -C repo config extensions.partialclone "arbitrary string" &&
386         git -C repo rev-list --exclude-promisor-objects --objects HEAD >out &&
387         grep $(git -C repo rev-parse HEAD) out &&
388         ! grep $BLOB out
389 '
390
391 test_expect_success 'rev-list stops traversal at promisor commit, tree, and blob' '
392         rm -rf repo &&
393         test_create_repo repo &&
394         test_commit -C repo foo &&
395         test_commit -C repo bar &&
396         test_commit -C repo baz &&
397
398         COMMIT=$(git -C repo rev-parse foo) &&
399         TREE=$(git -C repo rev-parse bar^{tree}) &&
400         BLOB=$(git hash-object repo/baz.t) &&
401         printf "%s\n%s\n%s\n" $COMMIT $TREE $BLOB | pack_as_from_promisor &&
402
403         git -C repo config core.repositoryformatversion 1 &&
404         git -C repo config extensions.partialclone "arbitrary string" &&
405         git -C repo rev-list --exclude-promisor-objects --objects HEAD >out &&
406         ! grep $COMMIT out &&
407         ! grep $TREE out &&
408         ! grep $BLOB out &&
409         grep $(git -C repo rev-parse bar) out  # sanity check that some walking was done
410 '
411
412 test_expect_success 'rev-list dies for missing objects on cmd line' '
413         rm -rf repo &&
414         test_create_repo repo &&
415         test_commit -C repo foo &&
416         test_commit -C repo bar &&
417         test_commit -C repo baz &&
418
419         COMMIT=$(git -C repo rev-parse foo) &&
420         TREE=$(git -C repo rev-parse bar^{tree}) &&
421         BLOB=$(git hash-object repo/baz.t) &&
422
423         promise_and_delete $COMMIT &&
424         promise_and_delete $TREE &&
425         promise_and_delete $BLOB &&
426
427         git -C repo config core.repositoryformatversion 1 &&
428         git -C repo config extensions.partialclone "arbitrary string" &&
429
430         for OBJ in "$COMMIT" "$TREE" "$BLOB"; do
431                 test_must_fail git -C repo rev-list --objects \
432                         --exclude-promisor-objects "$OBJ" &&
433                 test_must_fail git -C repo rev-list --objects-edge-aggressive \
434                         --exclude-promisor-objects "$OBJ" &&
435
436                 # Do not die or crash when --ignore-missing is passed.
437                 git -C repo rev-list --ignore-missing --objects \
438                         --exclude-promisor-objects "$OBJ" &&
439                 git -C repo rev-list --ignore-missing --objects-edge-aggressive \
440                         --exclude-promisor-objects "$OBJ"
441         done
442 '
443
444 test_expect_success 'single promisor remote can be re-initialized gracefully' '
445         # ensure one promisor is in the promisors list
446         rm -rf repo &&
447         test_create_repo repo &&
448         test_create_repo other &&
449         git -C repo remote add foo "file://$(pwd)/other" &&
450         git -C repo config remote.foo.promisor true &&
451         git -C repo config extensions.partialclone foo &&
452
453         # reinitialize the promisors list
454         git -C repo fetch --filter=blob:none foo
455 '
456
457 test_expect_success 'gc repacks promisor objects separately from non-promisor objects' '
458         rm -rf repo &&
459         test_create_repo repo &&
460         test_commit -C repo one &&
461         test_commit -C repo two &&
462
463         TREE_ONE=$(git -C repo rev-parse one^{tree}) &&
464         printf "$TREE_ONE\n" | pack_as_from_promisor &&
465         TREE_TWO=$(git -C repo rev-parse two^{tree}) &&
466         printf "$TREE_TWO\n" | pack_as_from_promisor &&
467
468         git -C repo config core.repositoryformatversion 1 &&
469         git -C repo config extensions.partialclone "arbitrary string" &&
470         git -C repo gc &&
471
472         # Ensure that exactly one promisor packfile exists, and that it
473         # contains the trees but not the commits
474         ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
475         test_line_count = 1 promisorlist &&
476         PROMISOR_PACKFILE=$(sed "s/.promisor/.pack/" <promisorlist) &&
477         git verify-pack $PROMISOR_PACKFILE -v >out &&
478         grep "$TREE_ONE" out &&
479         grep "$TREE_TWO" out &&
480         ! grep "$(git -C repo rev-parse one)" out &&
481         ! grep "$(git -C repo rev-parse two)" out &&
482
483         # Remove the promisor packfile and associated files
484         rm $(sed "s/.promisor//" <promisorlist).* &&
485
486         # Ensure that the single other pack contains the commits, but not the
487         # trees
488         ls repo/.git/objects/pack/pack-*.pack >packlist &&
489         test_line_count = 1 packlist &&
490         git verify-pack repo/.git/objects/pack/pack-*.pack -v >out &&
491         grep "$(git -C repo rev-parse one)" out &&
492         grep "$(git -C repo rev-parse two)" out &&
493         ! grep "$TREE_ONE" out &&
494         ! grep "$TREE_TWO" out
495 '
496
497 test_expect_success 'gc does not repack promisor objects if there are none' '
498         rm -rf repo &&
499         test_create_repo repo &&
500         test_commit -C repo one &&
501
502         git -C repo config core.repositoryformatversion 1 &&
503         git -C repo config extensions.partialclone "arbitrary string" &&
504         git -C repo gc &&
505
506         # Ensure that only one pack exists
507         ls repo/.git/objects/pack/pack-*.pack >packlist &&
508         test_line_count = 1 packlist
509 '
510
511 repack_and_check () {
512         rm -rf repo2 &&
513         cp -r repo repo2 &&
514         git -C repo2 repack $1 -d &&
515         git -C repo2 fsck &&
516
517         git -C repo2 cat-file -e $2 &&
518         git -C repo2 cat-file -e $3
519 }
520
521 test_expect_success 'repack -d does not irreversibly delete promisor objects' '
522         rm -rf repo &&
523         test_create_repo repo &&
524         git -C repo config core.repositoryformatversion 1 &&
525         git -C repo config extensions.partialclone "arbitrary string" &&
526
527         git -C repo commit --allow-empty -m one &&
528         git -C repo commit --allow-empty -m two &&
529         git -C repo commit --allow-empty -m three &&
530         git -C repo commit --allow-empty -m four &&
531         ONE=$(git -C repo rev-parse HEAD^^^) &&
532         TWO=$(git -C repo rev-parse HEAD^^) &&
533         THREE=$(git -C repo rev-parse HEAD^) &&
534
535         printf "$TWO\n" | pack_as_from_promisor &&
536         printf "$THREE\n" | pack_as_from_promisor &&
537         delete_object repo "$ONE" &&
538
539         repack_and_check -a "$TWO" "$THREE" &&
540         repack_and_check -A "$TWO" "$THREE" &&
541         repack_and_check -l "$TWO" "$THREE"
542 '
543
544 test_expect_success 'gc stops traversal when a missing but promised object is reached' '
545         rm -rf repo &&
546         test_create_repo repo &&
547         test_commit -C repo my_commit &&
548
549         TREE_HASH=$(git -C repo rev-parse HEAD^{tree}) &&
550         HASH=$(promise_and_delete $TREE_HASH) &&
551
552         git -C repo config core.repositoryformatversion 1 &&
553         git -C repo config extensions.partialclone "arbitrary string" &&
554         git -C repo gc &&
555
556         # Ensure that the promisor packfile still exists, and remove it
557         test -e repo/.git/objects/pack/pack-$HASH.pack &&
558         rm repo/.git/objects/pack/pack-$HASH.* &&
559
560         # Ensure that the single other pack contains the commit, but not the tree
561         ls repo/.git/objects/pack/pack-*.pack >packlist &&
562         test_line_count = 1 packlist &&
563         git verify-pack repo/.git/objects/pack/pack-*.pack -v >out &&
564         grep "$(git -C repo rev-parse HEAD)" out &&
565         ! grep "$TREE_HASH" out
566 '
567
568 test_expect_success 'do not fetch when checking existence of tree we construct ourselves' '
569         rm -rf repo &&
570         test_create_repo repo &&
571         test_commit -C repo base &&
572         test_commit -C repo side1 &&
573         git -C repo checkout base &&
574         test_commit -C repo side2 &&
575
576         git -C repo config core.repositoryformatversion 1 &&
577         git -C repo config extensions.partialclone "arbitrary string" &&
578
579         git -C repo cherry-pick side1
580 '
581
582 . "$TEST_DIRECTORY"/lib-httpd.sh
583 start_httpd
584
585 test_expect_success 'fetching of missing objects from an HTTP server' '
586         rm -rf repo &&
587         SERVER="$HTTPD_DOCUMENT_ROOT_PATH/server" &&
588         test_create_repo "$SERVER" &&
589         test_commit -C "$SERVER" foo &&
590         git -C "$SERVER" repack -a -d --write-bitmap-index &&
591
592         git clone $HTTPD_URL/smart/server repo &&
593         HASH=$(git -C repo rev-parse foo) &&
594         rm -rf repo/.git/objects/* &&
595
596         git -C repo config core.repositoryformatversion 1 &&
597         git -C repo config extensions.partialclone "origin" &&
598         git -C repo cat-file -p "$HASH" &&
599
600         # Ensure that the .promisor file is written, and check that its
601         # associated packfile contains the object
602         ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
603         test_line_count = 1 promisorlist &&
604         IDX=$(sed "s/promisor$/idx/" promisorlist) &&
605         git verify-pack --verbose "$IDX" >out &&
606         grep "$HASH" out
607 '
608
609 # DO NOT add non-httpd-specific tests here, because the last part of this
610 # test script is only executed when httpd is available and enabled.
611
612 test_done