File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -512,6 +512,11 @@ class CustomTree():
512512 def get_symlink_target (self , file_id ):
513513 return self .updates [file_id ]['data' ]
514514
515+ def c_style_unescape (string ):
516+ if string [0 ] == string [- 1 ] == '"' :
517+ return string .decode ('string-escape' )[1 :- 1 ]
518+ return string
519+
515520def parse_commit (parser ):
516521 global marks , blob_marks , bmarks , parsed_refs
517522 global mode
@@ -551,6 +556,7 @@ def parse_commit(parser):
551556 f = { 'deleted' : True }
552557 else :
553558 die ('Unknown file command: %s' % line )
559+ path = c_style_unescape (path ).decode ('utf-8' )
554560 files [path ] = f
555561
556562 repo = parser .repo
Original file line number Diff line number Diff line change @@ -204,4 +204,35 @@ test_expect_success 'fetch utf-8 filenames' '
204204 test_cmp expected actual
205205'
206206
207+ test_expect_success ' push utf-8 filenames' '
208+ mkdir -p tmp && cd tmp &&
209+ test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
210+
211+ export LC_ALL=en_US.UTF-8
212+
213+ (
214+ bzr init bzrrepo &&
215+ cd bzrrepo &&
216+
217+ echo one >> content &&
218+ bzr add content &&
219+ bzr commit -m one
220+ ) &&
221+
222+ (
223+ git clone "bzr::$PWD/bzrrepo" gitrepo &&
224+ cd gitrepo &&
225+
226+ echo test >> "áéíóú" &&
227+ git add "áéíóú" &&
228+ git commit -m utf-8 &&
229+
230+ git push
231+ ) &&
232+
233+ (cd bzrrepo && bzr ls > ../actual) &&
234+ echo -e "content\náéíóú" > expected &&
235+ test_cmp expected actual
236+ '
237+
207238test_done
You can’t perform that action at this time.
0 commit comments