summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 80dd7b4)
raw | patch | inline | side by side (parent: 80dd7b4)
author | Paul Mackerras <paulus@samba.org> | |
Sun, 27 Apr 2008 23:40:50 +0000 (09:40 +1000) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Sun, 27 Apr 2008 23:40:50 +0000 (09:40 +1000) |
Alex Riesen pointed out that displaying a commit in 'tree' mode fails
if some files have names with special characters such as '{' or '}' in
them, due to the fact that we treat the line returned from git ls-tree
as a Tcl list at one point.
This fixes it by doing what I originally intended but didn't quite
get right. We split the line from git ls-tree at the first tab and
treat the part before the tab as a list (which is OK since it doesn't
have special characters in it) and the part after the tab as the
filename.
Signed-off-by: Paul Mackerras <paulus@samba.org>
if some files have names with special characters such as '{' or '}' in
them, due to the fact that we treat the line returned from git ls-tree
as a Tcl list at one point.
This fixes it by doing what I originally intended but didn't quite
get right. We split the line from git ls-tree at the first tab and
treat the part before the tab as a list (which is OK since it doesn't
have special characters in it) and the part after the tab as the
filename.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 9a4d9c40cf6ec1bed01a2c2b950efb2d9887a8a5..da685aa63c728d62438e41efe3e34e1c7d8ba20e 100755 (executable)
--- a/gitk
+++ b/gitk
if {$diffids eq $nullid} {
set fname $line
} else {
- if {$diffids ne $nullid2 && [lindex $line 1] ne "blob"} continue
set i [string first "\t" $line]
if {$i < 0} continue
- set sha1 [lindex $line 2]
set fname [string range $line [expr {$i+1}] end]
+ set line [string range $line 0 [expr {$i-1}]]
+ if {$diffids ne $nullid2 && [lindex $line 1] ne "blob"} continue
+ set sha1 [lindex $line 2]
if {[string index $fname 0] eq "\""} {
set fname [lindex $fname 0]
}