Skip to content

Commit

Permalink
Merge branch 'fg/submodule-non-ascii-path'
Browse files Browse the repository at this point in the history
Many "git submodule" operations do not work on a submodule at a
path whose name is not in ASCII.

* fg/submodule-non-ascii-path:
  t7400: test of UTF-8 submodule names pass under Mac OS
  handle multibyte characters in name
  • Loading branch information
Junio C Hamano committed Jun 26, 2013
2 parents 9832cb9 + bed9470 commit 4f9ec8d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ resolve_relative_url ()
module_list()
{
(
git ls-files --error-unmatch --stage -- "$@" ||
git ls-files -z --error-unmatch --stage -- "$@" ||
echo "unmatched pathspec exists"
) |
perl -e '
my %unmerged = ();
my ($null_sha1) = ("0" x 40);
my @out = ();
my $unmatched = 0;
$/ = "\0";
while (<STDIN>) {
if (/^unmatched pathspec/) {
$unmatched = 1;
Expand Down
15 changes: 15 additions & 0 deletions t/t7400-submodule-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -868,4 +868,19 @@ 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 UTF-8 name' '
svname=$(printf "\303\245 \303\244\303\266") &&
mkdir "$svname" &&
(
cd "$svname" &&
git init &&
>sub &&
git add sub &&
git commit -m "init sub"
) &&
test_config core.precomposeunicode true &&
git submodule add ./"$svname" &&
git submodule >&2 &&
test -n "$(git submodule | grep "$svname")"
'
test_done

0 comments on commit 4f9ec8d

Please sign in to comment.