handle multibyte characters in name
Many "git submodule" operations do not work on a submodule at a path whose name is not in ASCII. This is because "git ls-files" is used to find which paths are bound to submodules to the current working tree, and the output is C-quoted by default for non ASCII pathnames. Tell "git ls-files" to not C-quote its output, which is easier than unwrapping C-quote ourselves. Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
edca415256
commit
74671241fd
@ -113,7 +113,7 @@ resolve_relative_url ()
|
||||
module_list()
|
||||
{
|
||||
(
|
||||
git ls-files --error-unmatch --stage -- "$@" ||
|
||||
git ls-files -z --error-unmatch --stage -- "$@" ||
|
||||
echo "unmatched pathspec exists"
|
||||
) |
|
||||
perl -e '
|
||||
@ -121,6 +121,7 @@ module_list()
|
||||
my ($null_sha1) = ("0" x 40);
|
||||
my @out = ();
|
||||
my $unmatched = 0;
|
||||
$/ = "\0";
|
||||
while (<STDIN>) {
|
||||
if (/^unmatched pathspec/) {
|
||||
$unmatched = 1;
|
||||
|
@ -868,4 +868,16 @@ test_expect_success 'submodule deinit fails when submodule has a .git directory
|
||||
test -n "$(git config --get-regexp "submodule\.example\.")"
|
||||
'
|
||||
|
||||
test_expect_success 'submodule with strange name works "å äö"' '
|
||||
mkdir "å äö" &&
|
||||
(
|
||||
cd "å äö" &&
|
||||
git init &&
|
||||
touch sub
|
||||
git add sub
|
||||
git commit -m "init sub"
|
||||
)
|
||||
git submodule add "/å äö" &&
|
||||
test -n "$(git submodule | grep "å äö")"
|
||||
'
|
||||
test_done
|
||||
|
Loading…
Reference in New Issue
Block a user