summaryrefslogtreecommitdiff
path: root/t/t1091-sparse-checkout-builtin.sh
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2020-02-11 15:02:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-11 17:06:47 (GMT)
commitef07659926f64d70e8cb41025c3d7456eecb962e (patch)
tree975f25bbaaebd3a374888a7e169e8d4a14f3dc9a /t/t1091-sparse-checkout-builtin.sh
parent2631dc879d59aa08095bc4fb5bc9bcc491a787e9 (diff)
downloadgit-ef07659926f64d70e8cb41025c3d7456eecb962e.zip
git-ef07659926f64d70e8cb41025c3d7456eecb962e.tar.gz
git-ef07659926f64d70e8cb41025c3d7456eecb962e.tar.bz2
sparse-checkout: work with Windows paths
When using Windows, a user may run 'git sparse-checkout set A\B\C' to add the Unix-style path A/B/C to their sparse-checkout patterns. Normalizing the input path converts the backslashes to slashes before we add the string 'A/B/C' to the recursive hashset. 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.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index f9265de..c35cbde 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -497,4 +497,18 @@ test_expect_success BSLASHPSPEC 'pattern-checks: escaped characters' '
test_cmp list-expect list-actual
'
+test_expect_success MINGW 'cone mode replaces backslashes with slashes' '
+ git -C repo sparse-checkout set deep\\deeper1 &&
+ cat >expect <<-\EOF &&
+ /*
+ !/*/
+ /deep/
+ !/deep/*/
+ /deep/deeper1/
+ EOF
+ test_cmp expect repo/.git/info/sparse-checkout &&
+ check_files repo a deep &&
+ check_files repo/deep a deeper1
+'
+
test_done