Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcbb5886

Browse files
committed
Unicode: tree_to_stream can now handle unicode names the way git would do it. Its can be assumed though that there are more bugs related to unicode hanging around in the system
1 parent33819a2 commitcbb5886

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎lib/git/objects/fun.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ def tree_to_stream(entries, write):
2525
mode_str=mode_str[1:]
2626
# END save a byte
2727

28+
# here it comes: if the name is actually unicode, the replacement below
29+
# will not work as the binsha is not part of the ascii unicode encoding -
30+
# hence we must convert to an utf8 string for it to work properly.
31+
# According to my tests, this is exactly what git does, that is it just
32+
# takes the input literally, which appears to be utf8 on linux.
33+
ifisinstance(name,unicode):
34+
name=name.encode("utf8")
2835
write("%s %s\0%s"% (mode_str,name,binsha))
2936
# END for each item
3037

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp