summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorFredrik Gustafsson <iveqy@iveqy.com>2013-06-14 02:26:02 +0200
committerJunio C Hamano <gitster@pobox.com>2013-06-14 08:04:32 -0700
commit74671241fd53df2899d4b4400593afc12e8e1bf7 (patch)
treec62bb8d3553257a4bf94ab674d9606b77d511308 /git-submodule.sh
parentedca4152560522a431a51fc0a06147fc680b5b18 (diff)
downloadgit-74671241fd53df2899d4b4400593afc12e8e1bf7.tar.gz
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>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh3
1 files changed, 2 insertions, 1 deletions
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 (<STDIN>) {
if (/^unmatched pathspec/) {
$unmatched = 1;