diff options
-rwxr-xr-x | git-submodule.sh | 3 | ||||
-rwxr-xr-x | t/t7400-submodule-basic.sh | 12 |
2 files changed, 14 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; diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index ff265353a3..d5743eeb4c 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -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 |