summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Johannes Sixt <j6t@kdbg.org>2009-07-21 10:09:48 +0200
committerLibravatar Paul Mackerras <paulus@samba.org>2009-08-13 21:49:09 +1000
commit097e11182213afa4166c0fe58bd8135d71b52fb5 (patch)
tree37aad7db5702b86b848094c4ec87b91bbd8735e9
parentgitk: Allow diff view without context lines (diff)
downloadtgif-097e11182213afa4166c0fe58bd8135d71b52fb5.tar.xz
gitk: Do not hard-code "encoding" in attribute lookup functions
Commit 39ee47e (Clean up file encoding code and add enable/disable option, 2008-10-15) rewrote the attribute lookup functions gitattr and cache_gitattr, but in the process hard-coded the attribute name "encoding" instead of using the functions' parameters. This fixes it. This is not a serious regression because currently all callers look only for "encoding". Further note that this fix assumes that future callers will not pass an attribute name that contains regex special characters. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk4
1 files changed, 2 insertions, 2 deletions
diff --git a/gitk b/gitk
index 4604c831fe..8aafb191aa 100755
--- a/gitk
+++ b/gitk
@@ -10901,7 +10901,7 @@ proc gitattr {path attr default} {
} else {
set r "unspecified"
if {![catch {set line [exec git check-attr $attr -- $path]}]} {
- regexp "(.*): encoding: (.*)" $line m f r
+ regexp "(.*): $attr: (.*)" $line m f r
}
set path_attr_cache($attr,$path) $r
}
@@ -10929,7 +10929,7 @@ proc cache_gitattr {attr pathlist} {
set newlist [lrange $newlist $lim end]
if {![catch {set rlist [eval exec git check-attr $attr -- $head]}]} {
foreach row [split $rlist "\n"] {
- if {[regexp "(.*): encoding: (.*)" $row m path value]} {
+ if {[regexp "(.*): $attr: (.*)" $row m path value]} {
if {[string index $path 0] eq "\""} {
set path [encoding convertfrom [lindex $path 0]]
}