gitk: Fix error message when clicking on a connecting line
authorStefan Haller <stefan@haller-berlin.de>
Thu, 4 Oct 2012 20:50:16 +0000 (22:50 +0200)
committerPaul Mackerras <paulus@samba.org>
Sun, 21 Oct 2012 22:24:46 +0000 (09:24 +1100)
When clicking on the line that connects two commit nodes, gitk
would bring up an error dialog saying "can't read "cflist_top":
no such variable".

This fixes a regression that was introduced with b967135 ("gitk:
Synchronize highlighting in file view when scrolling diff").

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk

diff --git a/gitk b/gitk
index 54cffde7214b101b677558e3b4935de2a86d83ed..a569c0d4b8a7616fdf0651251a021a5e03015501 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -7970,6 +7970,8 @@ proc changediffdisp {} {
 proc highlightfile {cline} {
     global cflist cflist_top
 
+    if {![info exists cflist_top]} return
+
     $cflist tag remove highlight $cflist_top.0 "$cflist_top.0 lineend"
     $cflist tag add highlight $cline.0 "$cline.0 lineend"
     $cflist see $cline.0