Skip to content

Commit

Permalink
gitk: Fix bug causing Tcl error when updating graph
Browse files Browse the repository at this point in the history
If "Show nearby tags" is turned off, selecting "Update" from the File
menu will cause a Tcl error.  This fixes it.  The problem was that
we were calling regetallcommits unconditionally, but it assumed that
getallcommits had been called previously.  This also restructures
{re,}getallcommits to be a bit simpler.

Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Paul Mackerras committed Aug 13, 2007
1 parent 7b459a1 commit a69b2d1
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ proc readcommit {id} {

proc updatecommits {} {
global viewdata curview phase displayorder
global children commitrow selectedline thickerline
global children commitrow selectedline thickerline showneartags

if {$phase ne {}} {
stop_rev_list
Expand All @@ -313,7 +313,9 @@ proc updatecommits {} {
catch {unset viewdata($n)}
readrefs
changedrefs
regetallcommits
if {$showneartags} {
getallcommits
}
showview $n
}

Expand Down Expand Up @@ -6199,17 +6201,13 @@ proc rmbranch {} {
proc getallcommits {} {
global allcommits allids nbmp nextarc seeds

set allids {}
set nbmp 0
set nextarc 0
set allcommits 0
set seeds {}
regetallcommits
}

# Called when the graph might have changed
proc regetallcommits {} {
global allcommits seeds
if {![info exists allcommits]} {
set allids {}
set nbmp 0
set nextarc 0
set allcommits 0
set seeds {}
}

set cmd [concat | git rev-list --all --parents]
foreach id $seeds {
Expand Down

0 comments on commit a69b2d1

Please sign in to comment.