Skip to content

git-gui:handle the encoding of Git's output correctly #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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