summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-08-28 16:14:40 -0500
committerJunio C Hamano <gitster@pobox.com>2013-08-29 11:39:45 -0700
commita8c0b74718d9986aec758e4a834a2d7363b16f24 (patch)
tree6785ce604b92bcfcddbf7a758781698876a96652 /contrib
parente230c568c4b9a991e3175e5f65171a566fd8e39c (diff)
downloadgit-a8c0b74718d9986aec758e4a834a2d7363b16f24.tar.gz
remote-bzr: fix export of utf-8 authors
Reported-by: Joakim Verona <joakim@verona.se> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/remote-helpers/git-remote-bzr1
-rwxr-xr-xcontrib/remote-helpers/test-bzr.sh30
2 files changed, 31 insertions, 0 deletions
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index c3a3cac77b..08b0b61ee3 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -168,6 +168,7 @@ class Parser:
if not m:
return None
_, name, email, date, tz = m.groups()
+ name = name.decode('utf-8')
committer = '%s <%s>' % (name, email)
tz = int(tz)
tz = ((tz / 100) * 3600) + ((tz % 100) * 60)
diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh
index dce281f911..b0d70fd339 100755
--- a/contrib/remote-helpers/test-bzr.sh
+++ b/contrib/remote-helpers/test-bzr.sh
@@ -358,4 +358,34 @@ test_expect_success 'strip' '
test_cmp expected actual
'
+test_expect_success 'export utf-8 authors' '
+ test_when_finished "rm -rf bzrrepo gitrepo && LC_ALL=C && unset GIT_COMMITTER_NAME" &&
+
+ LC_ALL=en_US.UTF-8
+ export LC_ALL
+
+ GIT_COMMITTER_NAME="Grégoire"
+ export GIT_COMMITTER_NAME
+
+ bzr init bzrrepo &&
+
+ (
+ git init gitrepo &&
+ cd gitrepo &&
+ echo greg >> content &&
+ git add content &&
+ git commit -m one &&
+ git remote add bzr "bzr::../bzrrepo" &&
+ git push bzr
+ ) &&
+
+ (
+ cd bzrrepo &&
+ bzr log | grep "^committer: " > ../actual
+ ) &&
+
+ echo "committer: Grégoire <committer@example.com>" > expected &&
+ test_cmp expected actual
+'
+
test_done