132
'
133
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
140
'
141
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
147
'
148
149
test_expect_success 'clone shallow depth 1 with fsck' '
240
test_expect_success 'deepening pull in shallow repo' '
241
(
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
247
)
248
'
249
314
test_expect_success 'turn shallow to complete repository' '
315
(
316
cd shallow &&
309
- git fetch --unshallow &&
317
+ GIT_TRACE2_EVENT="$(pwd)/trace2_event" \
318
+ git fetch --unshallow &&
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
323
)
324
'
325
837
'
838
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 &&
842
git -C shallow11 log --pretty=tformat:%s origin/main >actual &&
843
cat >expected <<-\EOF &&
844
three
845
two
846
EOF
835
- test_cmp expected actual
847
+ test_cmp expected actual &&
848
+ grep \"fetch-info\".*\"deepen-since\":true shallow11/trace2_event
849
'
850
851
test_expect_success 'clone shallow since selects no commits' '
1000
test_config -C server uploadpack.allowfilter 1 &&
1001
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 &&
1005
1006
# Ensure that object is not inadvertently fetched
1007
commit=$(git -C server rev-parse HEAD) &&
1008
blob=$(git hash-object server/one.t) &&
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
1013
'
1014
1015
test_expect_success 'filtering by size has no effect if support for it is not advertised' '