Skip to content

Commit d4247e0

Browse files
kkato233paulusmack
authored andcommitted
gitk: fix branch name encoding error
After "git checkout -b '漢字'" to create a branch with UTF-8 character in it, "gitk" shows the branch name incorrectly, as it forgets to turn the bytes read from the "git show-ref" command into Unicode characters. Signed-off-by: Kazuhiro Kato <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent b8b6095 commit d4247e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gitk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,11 +1780,15 @@ proc readrefs {} {
17801780
global otherrefids idotherrefs mainhead mainheadid
17811781
global selecthead selectheadid
17821782
global hideremotes
1783+
global tclencoding
17831784

17841785
foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
17851786
unset -nocomplain $v
17861787
}
17871788
set refd [open [list | git show-ref -d] r]
1789+
if {$tclencoding != {}} {
1790+
fconfigure $refd -encoding $tclencoding
1791+
}
17881792
while {[gets $refd line] >= 0} {
17891793
if {[string index $line 40] ne " "} continue
17901794
set id [string range $line 0 39]

0 commit comments

Comments
 (0)