From 74671241fd53df2899d4b4400593afc12e8e1bf7 Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Fri, 14 Jun 2013 02:26:02 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- git-submodule.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'git-submodule.sh') diff --git a/git-submodule.sh b/git-submodule.sh index 79bfaac9d4..48bdf84324 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -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 () { if (/^unmatched pathspec/) { $unmatched = 1; -- cgit v1.2.1