X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=git-gui%2Flib%2Fblame.tcl;h=96072847a2ffeec814f499657744e5ed4f8988c0;hb=b8de7f764e1a9f6e8dfb587a6145906394fa607d;hp=4bdb9a27a3dbcc60957f1a4eaed123faf3952bac;hpb=89b2f19cb516249b8d9546bb1f3f46a1ec5b3242;p=git.git diff --git a/git-gui/lib/blame.tcl b/git-gui/lib/blame.tcl index 4bdb9a27a..96072847a 100644 --- a/git-gui/lib/blame.tcl +++ b/git-gui/lib/blame.tcl @@ -370,6 +370,7 @@ method _load {jump} { $w_path conf -text [escape_path $path] if {$commit eq {}} { set fd [open $path r] + fconfigure $fd -eofchar {} } else { set fd [git_read cat-file blob "$commit:$path"] } @@ -770,15 +771,20 @@ method _showcommit {cur_w lno} { set enc [string tolower [string range $line 9 end]] } } - set msg [encoding convertfrom $enc [read $fd]] - set msg [string trim $msg] + set msg [read $fd] close $fd - set author_name [encoding convertfrom $enc $author_name] - set committer_name [encoding convertfrom $enc $committer_name] - - set header($cmit,author) $author_name - set header($cmit,committer) $committer_name + set enc [tcl_encoding $enc] + if {$enc ne {}} { + set msg [encoding convertfrom $enc $msg] + set author_name [encoding convertfrom $enc $author_name] + set committer_name [encoding convertfrom $enc $committer_name] + set header($cmit,author) $author_name + set header($cmit,committer) $committer_name + set header($cmit,summary) \ + [encoding convertfrom $enc $header($cmit,summary)] + } + set msg [string trim $msg] } set header($cmit,message) $msg } @@ -873,6 +879,11 @@ method _open_tooltip {cur_w} { set org [lindex $amov_data $lno] } + if {$dat eq {}} { + _hide_tooltip $this + return + } + set cmit [lindex $dat 0] set tooltip_commit [list $cmit]