Code

rehabilitate some t5302 tests on 32-bit off_t machines
[git.git] / gitk
diff --git a/gitk b/gitk
index 5230e3bb9df53c6b7244ccd5c573021275d3c93c..1da0b0af1d1da6c8596f366d7a36519b4e249c3b 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -830,11 +830,11 @@ proc makewindow {} {
     lappend entries $sstring
     trace add variable searchstring write incrsearch
     pack $sstring -side left -expand 1 -fill x
-    radiobutton .bleft.mid.diff -text "Diff" \
+    radiobutton .bleft.mid.diff -text "Diff" -font uifont \
        -command changediffdisp -variable diffelide -value {0 0}
-    radiobutton .bleft.mid.old -text "Old version" \
+    radiobutton .bleft.mid.old -text "Old version" -font uifont \
        -command changediffdisp -variable diffelide -value {0 1}
-    radiobutton .bleft.mid.new -text "New version" \
+    radiobutton .bleft.mid.new -text "New version" -font uifont \
        -command changediffdisp -variable diffelide -value {1 0}
     label .bleft.mid.labeldiffcontext -text "      Lines of context: " \
        -font uifont
@@ -5146,28 +5146,25 @@ proc startdiff {ids} {
 proc path_filter {filter name} {
     foreach p $filter {
        set l [string length $p]
-       if {[string compare -length $l $p $name] == 0 &&
-           ([string length $name] == $l || [string index $name $l] eq "/")} {
-           return 1
+       if {[string index $p end] eq "/"} {
+           if {[string compare -length $l $p $name] == 0} {
+               return 1
+           }
+       } else {
+           if {[string compare -length $l $p $name] == 0 &&
+               ([string length $name] == $l ||
+                [string index $name $l] eq "/")} {
+               return 1
+           }
        }
     }
     return 0
 }
 
 proc addtocflist {ids} {
-    global treediffs cflist viewfiles curview limitdiffs
+    global treediffs
 
-    if {$limitdiffs && $viewfiles($curview) ne {}} {
-       set flist {}
-       foreach f $treediffs($ids) {
-           if {[path_filter $viewfiles($curview) $f]} {
-               lappend flist $f
-           }
-       }
-    } else {
-       set flist $treediffs($ids)
-    }
-    add_flist $flist
+    add_flist $treediffs($ids)
     getblobdiffs $ids
 }
 
@@ -5223,7 +5220,7 @@ proc gettreediffs {ids} {
 
 proc gettreediffline {gdtf ids} {
     global treediff treediffs treepending diffids diffmergeid
-    global cmitmode
+    global cmitmode viewfiles curview limitdiffs
 
     set nr 0
     while {[incr nr] <= 1000 && [gets $gdtf line] >= 0} {
@@ -5240,7 +5237,17 @@ proc gettreediffline {gdtf ids} {
        return [expr {$nr >= 1000? 2: 1}]
     }
     close $gdtf
-    set treediffs($ids) $treediff
+    if {$limitdiffs && $viewfiles($curview) ne {}} {
+       set flist {}
+       foreach f $treediff {
+           if {[path_filter $viewfiles($curview) $f]} {
+               lappend flist $f
+           }
+       }
+       set treediffs($ids) $flist
+    } else {
+       set treediffs($ids) $treediff
+    }
     unset treepending
     if {$cmitmode eq "tree"} {
        gettree $diffids
@@ -8091,7 +8098,7 @@ proc prefsok {} {
     global maxwidth maxgraphpct
     global oldprefs prefstop showneartags showlocalchanges
     global fontpref mainfont textfont uifont
-    global limitdiffs
+    global limitdiffs treediffs
 
     catch {destroy $prefstop}
     unset prefstop
@@ -8124,6 +8131,10 @@ proc prefsok {} {
            dohidelocalchanges
        }
     }
+    if {$limitdiffs != $oldprefs(limitdiffs)} {
+       # treediffs elements are limited by path
+       catch {unset treediffs}
+    }
     if {$fontchanged || $maxwidth != $oldprefs(maxwidth)
        || $maxgraphpct != $oldprefs(maxgraphpct)} {
        redisplay