Skip to content

Commit d32e065

Browse files
committed
Merge branch 'kk/branch-name-encoding'
Fix UTF-8 refnames not displaying properly because the encoding was not set to UTF-8. * kk/branch-name-encoding: git gui: fix branch name encoding error
2 parents 2763530 + 39acfa3 commit d32e065

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

git-gui.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ proc load_current_branch {} {
684684
global current_branch is_detached
685685
686686
set fd [open [gitdir HEAD] r]
687+
fconfigure $fd -translation binary -encoding utf-8
687688
if {[gets $fd ref] < 1} {
688689
set ref {}
689690
}

lib/branch.tcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ proc load_all_heads {} {
88
set rh_len [expr {[string length $rh] + 1}]
99
set all_heads [list]
1010
set fd [git_read for-each-ref --format=%(refname) $rh]
11+
fconfigure $fd -translation binary -encoding utf-8
1112
while {[gets $fd line] > 0} {
1213
if {!$some_heads_tracking || ![is_tracking_branch $line]} {
1314
lappend all_heads [string range $line $rh_len end]
@@ -24,6 +25,7 @@ proc load_all_tags {} {
2425
--sort=-taggerdate \
2526
--format=%(refname) \
2627
refs/tags]
28+
fconfigure $fd -translation binary -encoding utf-8
2729
while {[gets $fd line] > 0} {
2830
if {![regsub ^refs/tags/ $line {} name]} continue
2931
lappend all_tags $name

0 commit comments

Comments
 (0)