summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuhiro Kato <kazuhiro.kato@hotmail.co.jp>2019-12-07 00:32:25 +0000
committerPaul Mackerras <paulus@ozlabs.org>2019-12-15 15:28:12 +1100
commitd4247e06027da5b3ac299fbba3a7443a919ca0ff (patch)
tree646894ba1a524f0da282ae87a2ceee20ce580361
parentb8b60957ce91b237b7f8925a3126b2662d3fcf41 (diff)
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>
-rwxr-xr-xgitk4
1 files changed, 4 insertions, 0 deletions
diff --git a/gitk b/gitk
index 6fab67127a..888ea5dcb2 100755
--- 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]