summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-04-23 22:07:50 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-04-23 22:07:50 -0700
commit5bceab4113f89eb29d0a737961f43135bf83d2d9 (patch)
treec0424898ce607d936cb89067d9fade57bfb9f8f6 /t
parentMerge branch 'jh/verify-index-checksum-only-in-fsck' (diff)
parentsubmodule: prevent backslash expantion in submodule names (diff)
downloadtgif-5bceab4113f89eb29d0a737961f43135bf83d2d9.tar.xz
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 cf77a3a357..c2706fe472 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 &&