]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gitk: fix branch name encoding error
authorKazuhiro Kato <kazuhiro.kato@hotmail.co.jp>
Sat, 7 Dec 2019 00:32:25 +0000 (00:32 +0000)
committerPaul Mackerras <paulus@ozlabs.org>
Sun, 15 Dec 2019 04:28:12 +0000 (15:28 +1100)
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>
gitk

diff --git a/gitk b/gitk
index 6fab67127adc805e54de4fc4e4123c0122141cbd..888ea5dcb20b8601baefeab4fb3d98e94e5a6b63 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -1780,11 +1780,15 @@ proc readrefs {} {
     global otherrefids idotherrefs mainhead mainheadid
     global selecthead selectheadid
     global hideremotes
+    global tclencoding
 
     foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
        unset -nocomplain $v
     }
     set refd [open [list | git show-ref -d] r]
+    if {$tclencoding != {}} {
+       fconfigure $refd -encoding $tclencoding
+    }
     while {[gets $refd line] >= 0} {
        if {[string index $line 40] ne " "} continue
        set id [string range $line 0 39]