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>
This commit is contained in:
parent
e230c568c4
commit
a8c0b74718
@ -168,6 +168,7 @@ class Parser:
|
|||||||
if not m:
|
if not m:
|
||||||
return None
|
return None
|
||||||
_, name, email, date, tz = m.groups()
|
_, name, email, date, tz = m.groups()
|
||||||
|
name = name.decode('utf-8')
|
||||||
committer = '%s <%s>' % (name, email)
|
committer = '%s <%s>' % (name, email)
|
||||||
tz = int(tz)
|
tz = int(tz)
|
||||||
tz = ((tz / 100) * 3600) + ((tz % 100) * 60)
|
tz = ((tz / 100) * 3600) + ((tz % 100) * 60)
|
||||||
|
@ -358,4 +358,34 @@ test_expect_success 'strip' '
|
|||||||
test_cmp expected actual
|
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
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user