@matheusbsbs / matheus-bagliano / commits / d4247e0602
Fork 0

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 <kato-k@ksysllc.co.jp> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>

Kazuhiro Kato committed Dec 7, 2019 at 00:32 UTC d4247e06027da5b3ac299fbba3a7443a919ca0ff
1 file changed +4
gitk
+4
@@ -1780,11 +1780,15 @@ proc readrefs {} {
1780 global otherrefids idotherrefs mainhead mainheadid
1781 global selecthead selectheadid
1782 global hideremotes
1783 + global tclencoding
1784
1785 foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
1786 unset -nocomplain $v
1787 }
1788 set refd [open [list | git show-ref -d] r]
1789 + if {$tclencoding != {}} {
1790 + fconfigure $refd -encoding $tclencoding
1791 + }
1792 while {[gets $refd line] >= 0} {
1793 if {[string index $line 40] ne " "} continue
1794 set id [string range $line 0 39]