@@ -132,13 +132,18 @@ test_expect_success 'single branch object count' '
132
132
'
133
133
134
134
test_expect_success ' single given branch clone' '
135
- git clone --single-branch --branch A "file://$(pwd)/." branch-a &&
136
- test_must_fail git --git-dir=branch-a/.git rev-parse origin/B
135
+ GIT_TRACE2_EVENT="$(pwd)/branch-a/trace2_event" \
136
+ git clone --single-branch --branch A "file://$(pwd)/." branch-a &&
137
+ test_must_fail git --git-dir=branch-a/.git rev-parse origin/B &&
138
+ grep \"fetch-info\".*\"haves\":0 branch-a/trace2_event &&
139
+ grep \"fetch-info\".*\"wants\":1 branch-a/trace2_event
137
140
'
138
141
139
142
test_expect_success ' clone shallow depth 1' '
140
- git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0 &&
141
- test "$(git --git-dir=shallow0/.git rev-list --count HEAD)" = 1
143
+ GIT_TRACE2_EVENT="$(pwd)/shallow0/trace2_event" \
144
+ git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0 &&
145
+ test "$(git --git-dir=shallow0/.git rev-list --count HEAD)" = 1 &&
146
+ grep \"fetch-info\".*\"depth\":1 shallow0/trace2_event
142
147
'
143
148
144
149
test_expect_success ' clone shallow depth 1 with fsck' '
@@ -235,7 +240,10 @@ test_expect_success 'add two more (part 2)' '
235
240
test_expect_success ' deepening pull in shallow repo' '
236
241
(
237
242
cd shallow &&
238
- git pull --depth 4 .. B
243
+ GIT_TRACE2_EVENT="$(pwd)/trace2_event" \
244
+ git pull --depth 4 .. B &&
245
+ grep \"fetch-info\".*\"depth\":4 trace2_event &&
246
+ grep \"fetch-info\".*\"shallows\":2 trace2_event
239
247
)
240
248
'
241
249
@@ -306,9 +314,12 @@ test_expect_success 'fetch --depth --no-shallow' '
306
314
test_expect_success ' turn shallow to complete repository' '
307
315
(
308
316
cd shallow &&
309
- git fetch --unshallow &&
317
+ GIT_TRACE2_EVENT="$(pwd)/trace2_event" \
318
+ git fetch --unshallow &&
310
319
! test -f .git/shallow &&
311
- git fsck --full
320
+ git fsck --full &&
321
+ grep \"fetch-info\".*\"shallows\":2 trace2_event &&
322
+ grep \"fetch-info\".*\"depth\":2147483647 trace2_event
312
323
)
313
324
'
314
325
@@ -826,13 +837,15 @@ test_expect_success 'clone shallow since ...' '
826
837
'
827
838
828
839
test_expect_success ' fetch shallow since ...' '
829
- git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
840
+ GIT_TRACE2_EVENT=$(pwd)/shallow11/trace2_event \
841
+ git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
830
842
git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
831
843
cat >expected <<-\EOF &&
832
844
three
833
845
two
834
846
EOF
835
- test_cmp expected actual
847
+ test_cmp expected actual &&
848
+ grep \"fetch-info\".*\"deepen-since\":true shallow11/trace2_event
836
849
'
837
850
838
851
test_expect_success ' clone shallow since selects no commits' '
@@ -987,13 +1000,16 @@ test_expect_success 'filtering by size' '
987
1000
test_config -C server uploadpack.allowfilter 1 &&
988
1001
989
1002
test_create_repo client &&
990
- git -C client fetch-pack --filter=blob:limit=0 ../server HEAD &&
1003
+ GIT_TRACE2_EVENT=$(pwd)/client/trace2_event \
1004
+ git -C client fetch-pack --filter=blob:limit=0 ../server HEAD &&
991
1005
992
1006
# Ensure that object is not inadvertently fetched
993
1007
commit=$(git -C server rev-parse HEAD) &&
994
1008
blob=$(git hash-object server/one.t) &&
995
1009
git -C client rev-list --objects --missing=allow-any "$commit" >oids &&
996
- ! grep "$blob" oids
1010
+ ! grep "$blob" oids &&
1011
+
1012
+ grep \"fetch-info\".*\"filter\":\"blob:limit\" client/trace2_event
997
1013
'
998
1014
999
1015
test_expect_success ' filtering by size has no effect if support for it is not advertised' '
0 commit comments