Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #323 from cloudchou/master
Browse files Browse the repository at this point in the history
git gui: handle Git's output encoding correctly
  • Loading branch information
dscho committed Mar 7, 2015
2 parents c47d6ec + 7020038 commit b21930f
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions git-gui/git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -526,31 +526,10 @@ proc _lappend_nice {cmd_var} {
}
proc git {args} {
set opt [list]
while {1} {
switch -- [lindex $args 0] {
--nice {
_lappend_nice opt
}
default {
break
}
}
set args [lrange $args 1 end]
}
set cmdp [_git_cmd [lindex $args 0]]
set args [lrange $args 1 end]
_trace_exec [concat $opt $cmdp $args]
set result [eval exec $opt $cmdp $args]
if {[encoding system] != "utf-8"} {
set result [encoding convertfrom utf-8 [encoding convertto $result]]
}
set fd [eval [list git_read] $args]
fconfigure $fd -translation binary -encoding utf-8
set result [string trimright [read $fd] "\n"]
close $fd
if {$::_trace} {
puts stderr "< $result"
}
Expand Down

0 comments on commit b21930f

Please sign in to comment.