Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15
STALE3719d

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 1/2] [submodule] handle multibyte characters in name

From: Fredrik Gustafsson <hidden>
Date: 2016-06-15 22:57:42
Subsystem: the rest · Maintainer: Linus Torvalds

Bugg reported here:
http://thread.gmane.org/gmane.comp.version-control.git/218922/focus=226791

Note that newline (\n) is still not supported and will not be until the
sh-script is replaced by something in an other language. This however
let us to use mostly all other strange characters.

Signed-off-by: Fredrik Gustafsson <redacted>
---
 git-submodule.sh           | 3 ++-
 t/t7400-submodule-basic.sh | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 79bfaac..31524d3 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -113,9 +113,10 @@ resolve_relative_url ()
 module_list()
 {
 	(
-		git ls-files --error-unmatch --stage -- "$@" ||
+		git ls-files --error-unmatch --stage -z -- "$@" ||
 		echo "unmatched pathspec exists"
 	) |
+	sed -e 's/\x00/\n/g' |
 	perl -e '
 	my %unmerged = ();
 	my ($null_sha1) = ("0" x 40);
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index ff26535..47ab7e7 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -868,4 +868,9 @@ 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 "å äö"' '
+	git init "å äö" &&
+	git submodule add "./å äö" &&
+	test -n "$(cat .gitmodules | grep "å äö")"
+'
 test_done
-- 
1.8.3.253.g20b40b5.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help