git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Fredrik Gustafsson <iveqy@iveqy.com>
To: iveqy@iveqy.com
Cc: gitster@pobox.com, git@vger.kernel.org, jens.lehmann@web.de,
	hvoigt@hvoigt.net
Subject: [PATCH 1/2] [submodule] handle multibyte characters in name
Date: Wed, 12 Jun 2013 01:04:13 +0200	[thread overview]
Message-ID: <1370991854-1414-2-git-send-email-iveqy@iveqy.com> (raw)
In-Reply-To: <1370991854-1414-1-git-send-email-iveqy@iveqy.com>

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@iveqy.com>
---
 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

  reply	other threads:[~2013-06-11 23:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11 23:04 [PATCH 0/2] module_list enhancements Fredrik Gustafsson
2013-06-11 23:04 ` Fredrik Gustafsson [this message]
2013-06-12 21:06   ` [PATCH 1/2] submodule: handle multibyte characters in name Junio C Hamano
2013-06-12 21:38     ` Jens Lehmann
2013-06-12 22:57       ` Junio C Hamano
2013-06-12 23:10         ` Fredrik Gustafsson
2013-06-13  1:41   ` [PATCH 1/2] [submodule] " Phil Hord
2013-06-11 23:04 ` [PATCH 2/2] [submodule] Replace perl-code with sh Fredrik Gustafsson
2013-06-12 21:08   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370991854-1414-2-git-send-email-iveqy@iveqy.com \
    --to=iveqy@iveqy.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hvoigt@hvoigt.net \
    --cc=jens.lehmann@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).