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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <iveqy@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]