aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-03-07 15:59:40 -0800
committerJunio C Hamano <gitster@pobox.com>2024-03-07 15:59:40 -0800
commit2c206fc82abb3ae3d8a5fb5b3c07c1a933007f31 (patch)
tree55466cec9abcec3afafe741324490c2c47367d3a /t
parent43072b4ca132437f21975ac6acc6b72dc22fd398 (diff)
parente6d5479e7ac301ae8d11daa3d8ef748e891c91c3 (diff)
downloadgit-2c206fc82abb3ae3d8a5fb5b3c07c1a933007f31.tar.gz
Merge branch 'jc/no-lazy-fetch'
"git --no-lazy-fetch cmd" allows to run "cmd" while disabling lazy fetching of objects from the promisor remote, which may be handy for debugging. * jc/no-lazy-fetch: git: extend --no-lazy-fetch to work across subprocesses git: document GIT_NO_REPLACE_OBJECTS environment variable git: --no-lazy-fetch option
Diffstat (limited to 't')
-rwxr-xr-xt/t0410-partial-clone.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh
index 0f98b21be8..88a66f0904 100755
--- a/t/t0410-partial-clone.sh
+++ b/t/t0410-partial-clone.sh
@@ -665,6 +665,21 @@ test_expect_success 'lazy-fetch when accessing object not in the_repository' '
git -C partial.git rev-list --objects --missing=print HEAD >out &&
grep "[?]$FILE_HASH" out &&
+ # The no-lazy-fetch mechanism prevents Git from fetching
+ test_must_fail env GIT_NO_LAZY_FETCH=1 \
+ git -C partial.git cat-file -e "$FILE_HASH" &&
+
+ # The same with command line option to "git"
+ test_must_fail git --no-lazy-fetch -C partial.git cat-file -e "$FILE_HASH" &&
+
+ # The same, forcing a subprocess via an alias
+ test_must_fail git --no-lazy-fetch -C partial.git \
+ -c alias.foo="!git cat-file" foo -e "$FILE_HASH" &&
+
+ # Sanity check that the file is still missing
+ git -C partial.git rev-list --objects --missing=print HEAD >out &&
+ grep "[?]$FILE_HASH" out &&
+
git -C full cat-file -s "$FILE_HASH" >expect &&
test-tool partial-clone object-info partial.git "$FILE_HASH" >actual &&
test_cmp expect actual &&