]> git.ipfire.org Git - thirdparty/git.git/commit - t/t7400-submodule-basic.sh
submodule: prevent backslash expantion in submodule names
authorBrandon Williams <bmwill@google.com>
Fri, 7 Apr 2017 17:23:06 +0000 (10:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Apr 2017 03:09:36 +0000 (20:09 -0700)
commitcf9e55f49438d07dd554c5ade92f1c266363af36
tree740370f17314a958359b2606562ab28153517dea
parentcf11a67975b057a144618badf16dc4e3d25b9407
submodule: prevent backslash expantion in submodule names

When attempting to add a submodule with backslashes in its name 'git
submodule' fails in a funny way.  We can see that some of the
backslashes are expanded resulting in a bogus path:

git -C main submodule add ../sub\\with\\backslash
fatal: repository '/tmp/test/sub\witackslash' does not exist
fatal: clone of '/tmp/test/sub\witackslash' into submodule path

To solve this, convert calls to 'read' to 'read -r' in git-submodule.sh
in order to prevent backslash expantion in submodule names.

Reported-by: Joachim Durchholz <jo@durchholz.org>
Signed-off-by: Brandon Williams <bmwill@google.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh
t/t7400-submodule-basic.sh