mirror of
https://github.com/git/git.git
synced 2024-11-01 23:07:55 +01:00
remote-bzr: add utf-8 support for fetching
[fc: added tests] Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
8954441ac7
commit
5445b24e22
2 changed files with 27 additions and 2 deletions
|
@ -223,7 +223,7 @@ def export_files(tree, files):
|
||||||
# is the blog already exported?
|
# is the blog already exported?
|
||||||
if h in filenodes:
|
if h in filenodes:
|
||||||
mark = filenodes[h]
|
mark = filenodes[h]
|
||||||
final.append((mode, mark, path))
|
final.append((mode, mark, path.encode('utf-8')))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
d = tree.get_file_text(fid)
|
d = tree.get_file_text(fid)
|
||||||
|
@ -240,7 +240,7 @@ def export_files(tree, files):
|
||||||
print "data %d" % len(d)
|
print "data %d" % len(d)
|
||||||
print d
|
print d
|
||||||
|
|
||||||
final.append((mode, mark, path))
|
final.append((mode, mark, path.encode('utf-8')))
|
||||||
|
|
||||||
return final
|
return final
|
||||||
|
|
||||||
|
|
|
@ -179,4 +179,29 @@ test_expect_success 'different authors' '
|
||||||
test_cmp expected actual
|
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
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue