aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-03-08 09:15:32 +1100
committerPaul Mackerras <paulus@samba.org>2006-03-08 09:15:32 +1100
commitb06bc2a0784cfb5cd9e1313201a16e08c73ff1c6 (patch)
treef0fa67db40bb1a0b89f1a4362755e5ed3c9b0fad
parent9f841cf1fbe4150a78555a45fd8a7794010975d4 (diff)
downloadgit-b06bc2a0784cfb5cd9e1313201a16e08c73ff1c6.tar.gz
git-b06bc2a0784cfb5cd9e1313201a16e08c73ff1c6.tar.xz
gitk: Fix display of diff lines beginning with --- or +++
Lines in a diff beginning with --- or +++ were not being displayed at all. Thanks to Robert Fitzsimons for pointing out the obvious fix, that lines beginning with --- or +++ are only to be suppressed in the diff header. I also took the opportunity to replace a regexp call with a couple of string compare calls, which should be faster. Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk4
1 files changed, 3 insertions, 1 deletions
diff --git a/gitk b/gitk
index 36e8647b3..3b8ecd03c 100755
--- a/gitk
+++ b/gitk
@@ -2615,7 +2615,9 @@ proc getblobdiffline {bdf ids} {
set pad [string range "----------------------------------------" 1 $l]
$ctext insert end "$pad $header $pad\n" filesep
set diffinhdr 1
- } elseif {[regexp {^(---|\+\+\+)} $line]} {
+ } elseif {$diffinhdr && [string compare -length 3 $line "---"] == 0} {
+ # do nothing
+ } elseif {$diffinhdr && [string compare -length 3 $line "+++"] == 0} {
set diffinhdr 0
} elseif {[regexp {^@@ -([0-9]+),([0-9]+) \+([0-9]+),([0-9]+) @@(.*)} \
$line match f1l f1c f2l f2c rest]} {