summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-04-24 05:07:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-24 05:07:50 (GMT)
commit5bceab4113f89eb29d0a737961f43135bf83d2d9 (patch)
treec0424898ce607d936cb89067d9fade57bfb9f8f6 /t
parentcdfe138b360cd10f74ef9d2d031cb10447cb3338 (diff)
parentcf9e55f49438d07dd554c5ade92f1c266363af36 (diff)
downloadgit-5bceab4113f89eb29d0a737961f43135bf83d2d9.zip
git-5bceab4113f89eb29d0a737961f43135bf83d2d9.tar.gz
git-5bceab4113f89eb29d0a737961f43135bf83d2d9.tar.bz2
Merge branch 'bw/submodule-with-bs-path'
"git submodule" script does not work well with strange pathnames. Protect it from a path with slashes in them, at least. * bw/submodule-with-bs-path: submodule: prevent backslash expantion in submodule names
Diffstat (limited to 't')
-rwxr-xr-xt/t7400-submodule-basic.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index cf77a3a..c2706fe 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -273,6 +273,20 @@ test_expect_success 'submodule add with ./, /.. and // in path' '
test_cmp empty untracked
'
+test_expect_success 'submodule add with \\ in path' '
+ test_when_finished "rm -rf parent sub\\with\\backslash" &&
+
+ # Initialize a repo with a backslash in its name
+ git init sub\\with\\backslash &&
+ touch sub\\with\\backslash/empty.file &&
+ git -C sub\\with\\backslash add empty.file &&
+ git -C sub\\with\\backslash commit -m "Added empty.file" &&
+
+ # Add that repository as a submodule
+ git init parent &&
+ git -C parent submodule add ../sub\\with\\backslash
+'
+
test_expect_success 'submodule add in subdirectory' '
echo "refs/heads/master" >expect &&
>empty &&