gitk: Simplify file filtering

git diff is perfectly able to do this with '-- files', no need for manual filtering. This makes gettreediffs consistent with getblobdiffs. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>

Felipe Contreras committed Apr 27, 2013 at 17:01 UTC 2c8cd905d14e910de2a820178edf99b61f34a0c5
1 file changed +7 -13
gitk
+7 -13
@@ -7618,9 +7618,13 @@ proc diffcmd {ids flags} {
7618 }
7619
7620 proc gettreediffs {ids} {
7621 - global treediff treepending
7621 + global treediff treepending limitdiffs vfilelimit curview
7622
7623 - if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
7623 + set cmd [diffcmd $ids {--no-commit-id}]
7624 + if {$limitdiffs && $vfilelimit($curview) ne {}} {
7625 + set cmd [concat $cmd -- $vfilelimit($curview)]
7626 + }
7627 + if {[catch {set gdtf [open $cmd r]}]} return
7628
7629 set treepending $ids
7630 set treediff {}
@@ -7664,17 +7668,7 @@ proc gettreediffline {gdtf ids} {
7668 return [expr {$nr >= $max? 2: 1}]
7669 }
7670 close $gdtf
7667 - if {$limitdiffs && $vfilelimit($curview) ne {}} {
7668 - set flist {}
7669 - foreach f $treediff {
7670 - if {[path_filter $vfilelimit($curview) $f]} {
7671 - lappend flist $f
7672 - }
7673 - }
7674 - set treediffs($ids) $flist
7675 - } else {
7676 - set treediffs($ids) $treediff
7677 - }
7671 + set treediffs($ids) $treediff
7672 unset treepending
7673 if {$cmitmode eq "tree" && [llength $diffids] == 1} {
7674 gettree $diffids