@@ -36,42 +36,8 @@ test_expect_success 'extensions.partialclone without filter' '
36
36
git -C client fetch origin
37
37
'
38
38
39
- test_expect_success ' convert shallow clone to partial clone' '
40
- rm -fr server client &&
41
- test_create_repo server &&
42
- test_commit -C server my_commit 1 &&
43
- test_commit -C server my_commit2 1 &&
44
- git clone --depth=1 "file://$(pwd)/server" client &&
45
- git -C client fetch --unshallow --filter="blob:none" &&
46
- test_cmp_config -C client true remote.origin.promisor &&
47
- test_cmp_config -C client blob:none remote.origin.partialclonefilter &&
48
- test_cmp_config -C client 1 core.repositoryformatversion
49
- '
50
-
51
- test_expect_success DEFAULT_REPO_FORMAT ' convert to partial clone with noop extension' '
52
- rm -fr server client &&
53
- test_create_repo server &&
54
- test_commit -C server my_commit 1 &&
55
- test_commit -C server my_commit2 1 &&
56
- git clone --depth=1 "file://$(pwd)/server" client &&
57
- test_cmp_config -C client 0 core.repositoryformatversion &&
58
- git -C client config extensions.noop true &&
59
- git -C client fetch --unshallow --filter="blob:none"
60
- '
61
-
62
- test_expect_success DEFAULT_REPO_FORMAT ' converting to partial clone fails with unrecognized extension' '
63
- rm -fr server client &&
64
- test_create_repo server &&
65
- test_commit -C server my_commit 1 &&
66
- test_commit -C server my_commit2 1 &&
67
- git clone --depth=1 "file://$(pwd)/server" client &&
68
- test_cmp_config -C client 0 core.repositoryformatversion &&
69
- git -C client config extensions.nonsense true &&
70
- test_must_fail git -C client fetch --unshallow --filter="blob:none"
71
- '
72
-
73
39
test_expect_success ' missing reflog object, but promised by a commit, passes fsck' '
74
- rm -rf repo &&
40
+ rm -rf server client &&
75
41
test_create_repo repo &&
76
42
test_commit -C repo my_commit &&
77
43
@@ -240,7 +206,7 @@ test_expect_success 'fetching of missing objects works with ref-in-want enabled'
240
206
grep "fetch< fetch=.*ref-in-want" trace
241
207
'
242
208
243
- test_expect_success ' fetching from another promisor remote' '
209
+ test_expect_success ' fetching of missing objects from another promisor remote' '
244
210
git clone "file://$(pwd)/server" server2 &&
245
211
test_commit -C server2 bar &&
246
212
git -C server2 repack -a -d --write-bitmap-index &&
@@ -263,32 +229,8 @@ test_expect_success 'fetching from another promisor remote' '
263
229
grep "$HASH2" out
264
230
'
265
231
266
- test_expect_success ' fetching with --filter configures a promisor remote' '
267
- test_create_repo server3 &&
268
- test_commit -C server3 baz &&
269
- git -C server3 repack -a -d --write-bitmap-index &&
270
- HASH3=$(git -C server3 rev-parse baz) &&
271
- git -C server3 config uploadpack.allowfilter 1 &&
272
-
273
- rm repo/.git/objects/pack/pack-*.promisor &&
274
-
275
- git -C repo remote add server3 "file://$(pwd)/server3" &&
276
- git -C repo fetch --filter="blob:none" server3 $HASH3 &&
277
-
278
- test_cmp_config -C repo true remote.server3.promisor &&
279
-
280
- # Ensure that the .promisor file is written, and check that its
281
- # associated packfile contains the object
282
- ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
283
- test_line_count = 1 promisorlist &&
284
- IDX=$(sed "s/promisor$/idx/" promisorlist) &&
285
- git verify-pack --verbose "$IDX" >out &&
286
- grep "$HASH3" out
287
- '
288
-
289
232
test_expect_success ' fetching of missing blobs works' '
290
233
rm -rf server server2 repo &&
291
- rm -rf server server3 repo &&
292
234
test_create_repo server &&
293
235
test_commit -C server foo &&
294
236
git -C server repack -a -d --write-bitmap-index &&
@@ -776,6 +718,65 @@ test_expect_success 'fetching of missing objects from an HTTP server' '
776
718
grep "$HASH" out
777
719
'
778
720
721
+ test_expect_success ' convert shallow clone to partial clone' '
722
+ rm -rf repo &&
723
+ SERVER="$HTTPD_DOCUMENT_ROOT_PATH/server" &&
724
+ test_create_repo "$SERVER" &&
725
+ test_commit -C "$SERVER" my_commit 1 &&
726
+ test_commit -C "$SERVER" my_commit2 1 &&
727
+ git clone --depth=1 "$HTTPD_URL/smart/server" repo &&
728
+ git -C repo fetch --unshallow --filter="blob:none" &&
729
+ test_cmp_config -C repo true remote.origin.promisor &&
730
+ test_cmp_config -C repo blob:none remote.origin.partialclonefilter &&
731
+ test_cmp_config -C repo 1 core.repositoryformatversion
732
+ '
733
+
734
+ test_expect_success DEFAULT_REPO_FORMAT ' convert to partial clone with noop extension' '
735
+ rm -rf repo &&
736
+ SERVER="$HTTPD_DOCUMENT_ROOT_PATH/server" &&
737
+ test_create_repo "$SERVER" &&
738
+ test_commit -C "$SERVER" my_commit 1 &&
739
+ test_commit -C "$SERVER" my_commit2 1 &&
740
+ git clone --depth=1 "$HTTPD_URL/smart/server" repo &&
741
+ test_cmp_config -C repo 0 core.repositoryformatversion &&
742
+ git -C repo config extensions.noop true &&
743
+ git -C repo fetch --unshallow --filter="blob:none"
744
+ '
745
+
746
+ test_expect_success DEFAULT_REPO_FORMAT ' converting to partial clone fails with unrecognized extension' '
747
+ rm -rf repo &&
748
+ SERVER="$HTTPD_DOCUMENT_ROOT_PATH/server" &&
749
+ test_create_repo "$SERVER" &&
750
+ test_commit -C "$SERVER" my_commit 1 &&
751
+ test_commit -C "$SERVER" my_commit2 1 &&
752
+ git clone --depth=1 "$HTTPD_URL/smart/server" repo &&
753
+ test_cmp_config -C repo 0 core.repositoryformatversion &&
754
+ git -C repo config extensions.nonsense true &&
755
+ test_must_fail git -C repo fetch --unshallow
756
+ '
757
+
758
+ test_expect_success ' fetching of missing objects configures a promisor remote' '
759
+ rm -rf repo &&
760
+ git clone "$HTTPD_URL/smart/server" server3 &&
761
+ test_commit -C server3 baz &&
762
+ git -C server3 repack -a -d --write-bitmap-index &&
763
+ HASH3=$(git -C server3 rev-parse baz) &&
764
+ git -C server3 config uploadpack.allowfilter 1 &&
765
+
766
+ rm repo/.git/objects/pack/pack-*.promisor &&
767
+
768
+ git -C repo remote add server3 "$HTTPD_URL/smart/server3" &&
769
+ git -C repo fetch --filter="blob:none" server3 $HASH3 &&
770
+
771
+ test_cmp_config -C repo true remote.server3.promisor &&
772
+
773
+ ls repo/.git/objects/pack/pack-*.promisor >promisorlist &&
774
+ test_line_count = 1 promisorlist &&
775
+ IDX=$(sed "s/promisor$/idx/" promisorlist) &&
776
+ git verify-pack --verbose "$IDX" >out &&
777
+ grep "$HASH3" out
778
+ '
779
+
779
780
# DO NOT add non-httpd-specific tests here, because the last part of this
780
781
# test script is only executed when httpd is available and enabled.
781
782
0 commit comments