summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-04-08 13:53:48 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-04-08 13:53:48 -0700
commite7109d5c7c6863be1a0793ffdc64b6dba416a7d5 (patch)
tree6163b71981911f467455642e3df4c75eaf22da28 /t
parentMerge branch 'tl/ls-tree-oid-only' (diff)
parentt9902: split test to run on appropriate systems (diff)
downloadtgif-e7109d5c7c6863be1a0793ffdc64b6dba416a7d5.tar.xz
Merge branch 'ld/sparse-index-bash-completion'
Test regression fix. * ld/sparse-index-bash-completion: t9902: split test to run on appropriate systems
Diffstat (limited to 't')
-rwxr-xr-xt/t9902-completion.sh35
1 files changed, 26 insertions, 9 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 24117cb901..31526e6b64 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1529,28 +1529,45 @@ test_expect_success 'cone mode sparse-checkout completes directory names with sp
)
'
-# use FUNNYNAMES to avoid running on Windows, which doesn't permit backslashes or tabs in paths
-test_expect_success FUNNYNAMES 'cone mode sparse-checkout completes directory names with backslashes and tabs' '
+# use FUNNYNAMES to avoid running on Windows, which doesn't permit tabs in paths
+test_expect_success FUNNYNAMES 'cone mode sparse-checkout completes directory names with tabs' '
# reset sparse-checkout
git -C sparse-checkout sparse-checkout disable &&
(
cd sparse-checkout &&
- mkdir "directory\with\backslashes" &&
mkdir "$(printf "directory\twith\ttabs")" &&
- >"directory\with\backslashes/randomfile" &&
>"$(printf "directory\twith\ttabs")/randomfile" &&
git add . &&
- git commit -m "Add directory with backslashes and directory with tabs" &&
- git sparse-checkout set --cone "directory\with\backslashes" \
+ git commit -m "Add directory with tabs" &&
+ git sparse-checkout set --cone \
"$(printf "directory\twith\ttabs")" &&
test_completion "git sparse-checkout add dir" <<-\EOF &&
- directory\with\backslashes/
directory with tabs/
EOF
- rm -rf "directory\with\backslashes" &&
rm -rf "$(printf "directory\twith\ttabs")" &&
git add . &&
- git commit -m "Remove directory with backslashes and directory with tabs"
+ git commit -m "Remove directory with tabs"
+ )
+'
+
+# use FUNNYNAMES to avoid running on Windows, and !CYGWIN for Cygwin, as neither permit backslashes in paths
+test_expect_success FUNNYNAMES,!CYGWIN 'cone mode sparse-checkout completes directory names with backslashes' '
+ # reset sparse-checkout
+ git -C sparse-checkout sparse-checkout disable &&
+ (
+ cd sparse-checkout &&
+ mkdir "directory\with\backslashes" &&
+ >"directory\with\backslashes/randomfile" &&
+ git add . &&
+ git commit -m "Add directory with backslashes" &&
+ git sparse-checkout set --cone \
+ "directory\with\backslashes" &&
+ test_completion "git sparse-checkout add dir" <<-\EOF &&
+ directory\with\backslashes/
+ EOF
+ rm -rf "directory\with\backslashes" &&
+ git add . &&
+ git commit -m "Remove directory with backslashes"
)
'