summaryrefslogtreecommitdiff
path: root/t/t1091-sparse-checkout-builtin.sh
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2020-01-24 21:19:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-01-24 21:26:54 (GMT)
commit47dbf10d8a5ce8c9b441a16b7698c7d70585dff0 (patch)
tree1456d61c3980c0c4a4ed1431548037f712400027 /t/t1091-sparse-checkout-builtin.sh
parent3c754067a1164ffafd965dcd44a9f004e6100e42 (diff)
downloadgit-47dbf10d8a5ce8c9b441a16b7698c7d70585dff0.zip
git-47dbf10d8a5ce8c9b441a16b7698c7d70585dff0.tar.gz
git-47dbf10d8a5ce8c9b441a16b7698c7d70585dff0.tar.bz2
clone: fix --sparse option with URLs
The --sparse option was added to the clone builtin in d89f09c (clone: add --sparse mode, 2019-11-21) and was tested with a local path clone in t1091-sparse-checkout-builtin.sh. However, due to a difference in how local paths are handled versus URLs, this mechanism does not work with URLs. Modify the test to use a "file://" URL, which would output this error before the code change: Cloning into 'clone'... fatal: cannot change to 'file://.../repo': No such file or directory error: failed to initialize sparse-checkout These errors are due to using a "-C <path>" option to call 'git -C <path> sparse-checkout init' but the URL is being given instead of the target directory. Update that target directory to evaluate this correctly. I have also manually tested that https:// URLs are handled correctly as well. Acked-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1091-sparse-checkout-builtin.sh')
-rwxr-xr-xt/t1091-sparse-checkout-builtin.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index 43d1f75..cf4a595 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -90,7 +90,7 @@ test_expect_success 'init with existing sparse-checkout' '
'
test_expect_success 'clone --sparse' '
- git clone --sparse repo clone &&
+ git clone --sparse "file://$(pwd)/repo" clone &&
git -C clone sparse-checkout list >actual &&
cat >expect <<-\EOF &&
/*