diff options
Diffstat (limited to 'git-gui/lib/blame.tcl')
-rw-r--r-- | git-gui/lib/blame.tcl | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/git-gui/lib/blame.tcl b/git-gui/lib/blame.tcl index 4bdb9a27a3..96072847a2 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] |