Skip to content

Commit d8d13af

Browse files
committed
Address review feedback: simplify filter e2e tests and fix partial clone verification
- Remove redundant `echo "${FUNCNAME[0]}" > "$REPO/file"` in filter_partial_clone_blob_none and filter_with_sparse_checkout; init_repo already initializes $REPO/file with the funcname. - Replace the silently-failing `remote.origin.partialclonefilter` check (git-sync fetches by URL, not via the "origin" remote, so the config keys are never set) with a check for the `.promisor` pack marker that `git fetch --filter` produces.
1 parent 0d0782f commit d8d13af

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

test_e2e.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3343,9 +3343,6 @@ function e2e::sparse_checkout() {
33433343
# Test filter (partial clone) with blob:none
33443344
##############################################
33453345
function e2e::filter_partial_clone_blob_none() {
3346-
echo "${FUNCNAME[0]}" > "$REPO/file"
3347-
git -C "$REPO" commit -qam "${FUNCNAME[0]}"
3348-
33493346
GIT_SYNC \
33503347
--one-time \
33513348
--repo="file://$REPO" \
@@ -3357,14 +3354,12 @@ function e2e::filter_partial_clone_blob_none() {
33573354
assert_file_exists "$ROOT/link/file"
33583355
assert_file_eq "$ROOT/link/file" "${FUNCNAME[0]}"
33593356

3360-
# Verify the repo is a partial clone
3361-
if ! git -C "$ROOT/link" config --get remote.origin.promisor >/dev/null 2>&1; then
3362-
# Check if the repo has a partial clone filter configured
3363-
local filter
3364-
filter=$(git -C "$ROOT/link" config --get remote.origin.partialclonefilter 2>/dev/null || true)
3365-
if [[ -z "$filter" ]]; then
3366-
fail "expected partial clone filter to be configured"
3367-
fi
3357+
# Verify partial clone is in effect: git fetch --filter creates a
3358+
# .promisor marker alongside each pack file containing filtered objects.
3359+
local pack_dir
3360+
pack_dir="$(git -C "$ROOT/link" rev-parse --git-common-dir)/objects/pack"
3361+
if ! ls "$pack_dir"/*.promisor >/dev/null 2>&1; then
3362+
fail "expected .promisor pack marker (partial clone)"
33683363
fi
33693364
}
33703365

@@ -3375,7 +3370,6 @@ function e2e::filter_with_sparse_checkout() {
33753370
echo "!/*" > "$WORK/sparseconfig"
33763371
echo "!/*/" >> "$WORK/sparseconfig"
33773372
echo "file2" >> "$WORK/sparseconfig"
3378-
echo "${FUNCNAME[0]}" > "$REPO/file"
33793373
echo "${FUNCNAME[0]}" > "$REPO/file2"
33803374
mkdir -p "$REPO/dir"
33813375
echo "${FUNCNAME[0]}" > "$REPO/dir/file3"

0 commit comments

Comments
 (0)