summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-04-27 17:01:39 -0500
committerPaul Mackerras <paulus@samba.org>2013-05-11 17:37:08 +1000
commit2c8cd905d14e910de2a820178edf99b61f34a0c5 (patch)
tree436f7563932c6beda109e73faa9115be7317586b
parent685316c419caf4f4ec2e81e607d3e3ab089e329c (diff)
downloadgit-2c8cd905d14e910de2a820178edf99b61f34a0c5.tar.gz
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>
-rwxr-xr-xgitk20
1 files changed, 7 insertions, 13 deletions
diff --git a/gitk b/gitk
index 8d0501b48f..b80a805e41 100755
--- a/gitk
+++ b/gitk
@@ -7618,9 +7618,13 @@ proc diffcmd {ids flags} {
}
proc gettreediffs {ids} {
- global treediff treepending
+ global treediff treepending limitdiffs vfilelimit curview
- if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
+ set cmd [diffcmd $ids {--no-commit-id}]
+ if {$limitdiffs && $vfilelimit($curview) ne {}} {
+ set cmd [concat $cmd -- $vfilelimit($curview)]
+ }
+ if {[catch {set gdtf [open $cmd r]}]} return
set treepending $ids
set treediff {}
@@ -7664,17 +7668,7 @@ proc gettreediffline {gdtf ids} {
return [expr {$nr >= $max? 2: 1}]
}
close $gdtf
- if {$limitdiffs && $vfilelimit($curview) ne {}} {
- set flist {}
- foreach f $treediff {
- if {[path_filter $vfilelimit($curview) $f]} {
- lappend flist $f
- }
- }
- set treediffs($ids) $flist
- } else {
- set treediffs($ids) $treediff
- }
+ set treediffs($ids) $treediff
unset treepending
if {$cmitmode eq "tree" && [llength $diffids] == 1} {
gettree $diffids