Skip to content

Commit

Permalink
remote-bzr: add utf-8 support for fetching
Browse files Browse the repository at this point in the history
[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Timotheus Pokorra authored and Junio C Hamano committed Apr 7, 2013
1 parent 8954441 commit 5445b24
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/remote-helpers/git-remote-bzr
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def export_files(tree, files):
# is the blog already exported?
if h in filenodes:
mark = filenodes[h]
final.append((mode, mark, path))
final.append((mode, mark, path.encode('utf-8')))
continue

d = tree.get_file_text(fid)
Expand All @@ -240,7 +240,7 @@ def export_files(tree, files):
print "data %d" % len(d)
print d

final.append((mode, mark, path))
final.append((mode, mark, path.encode('utf-8')))

return final

Expand Down
25 changes: 25 additions & 0 deletions contrib/remote-helpers/test-bzr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,29 @@ test_expect_success 'different authors' '
test_cmp expected actual
'

test_expect_success 'fetch utf-8 filenames' '
mkdir -p tmp && cd tmp &&
test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
export LC_ALL=en_US.UTF-8
(
bzr init bzrrepo &&
cd bzrrepo &&
echo test >> "áéíóú" &&
bzr add "áéíóú" &&
bzr commit -m utf-8
) &&
(
git clone "bzr::$PWD/bzrrepo" gitrepo &&
cd gitrepo &&
git ls-files > ../actual
) &&
echo "\"\\303\\241\\303\\251\\303\\255\\303\\263\\303\\272\"" > expected &&
test_cmp expected actual
'

test_done

0 comments on commit 5445b24

Please sign in to comment.