Skip to content

Commit f1743ad

Browse files
committed
Merge branch 'th/backfill-auto-detect-sparseness-fix'
"git backfill" is capable of auto-detecting a sparsely checked out working tree, which was broken. * th/backfill-auto-detect-sparseness-fix: backfill: auto-detect sparse-checkout from config
2 parents b66c97c + 339eba6 commit f1743ad

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

builtin/backfill.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int cmd_backfill(int argc, const char **argv, const char *prefix, struct reposit
119119
.repo = repo,
120120
.current_batch = OID_ARRAY_INIT,
121121
.min_batch_size = 50000,
122-
.sparse = 0,
122+
.sparse = -1,
123123
.revs = REV_INFO_INIT,
124124
};
125125
struct option options[] = {

t/t5620-backfill.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,21 @@ test_expect_success 'backfill --sparse' '
175175
test_line_count = 0 missing
176176
'
177177

178+
test_expect_success 'backfill auto-detects sparse-checkout from config' '
179+
git clone --sparse --filter=blob:none \
180+
--single-branch --branch=main \
181+
"file://$(pwd)/srv.bare" backfill-auto-sparse &&
182+
183+
git -C backfill-auto-sparse rev-list --quiet --objects --missing=print HEAD >missing &&
184+
test_line_count = 44 missing &&
185+
186+
GIT_TRACE2_EVENT="$(pwd)/auto-sparse-trace" git \
187+
-C backfill-auto-sparse backfill &&
188+
189+
test_trace2_data promisor fetch_count 4 <auto-sparse-trace &&
190+
test_trace2_data path-walk paths 5 <auto-sparse-trace
191+
'
192+
178193
test_expect_success 'backfill --sparse without cone mode (positive)' '
179194
git clone --no-checkout --filter=blob:none \
180195
--single-branch --branch=main \

0 commit comments

Comments
 (0)