summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-gui.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/git-gui.sh b/git-gui.sh
index f71dabe68a..37757cfb65 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -640,6 +640,14 @@ proc show_diff {path w {lno {}}} {
return
}
$ui_diff conf -state normal
+ if {![catch {set type [exec file $path]}]} {
+ set n [string length $path]
+ if {[string equal -length $n $path $type]} {
+ set type [string range $type $n end]
+ regsub {^:?\s*} $type {} type
+ }
+ $ui_diff insert end "* $type\n" d_@
+ }
if {[string first "\0" $content] != -1} {
$ui_diff insert end \
"* Binary file (not showing content)." \