Skip to content

Commit

Permalink
gitk: Don't try to show local changes from a head that isn't shown
Browse files Browse the repository at this point in the history
When updating the display, if the checked-out head has moved on and
isn't currently shown, and there are local changes, we could try to
insert a fake row with a parent that isn't displayed, leading to a
Tcl error.  This is because we check whether the checked-out head
is displayed before rereading the references (which is when we discover
that the head has moved).  This fixes it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Paul Mackerras committed Dec 29, 2007
1 parent fc2a256 commit eb5f8c9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,18 @@ proc updatecommits {} {
global curview viewargs viewfiles viewincl viewinstances
global viewactive viewcomplete loginstance tclencoding mainheadid
global varcid startmsecs commfd showneartags showlocalchanges leftover
global mainheadid

if {$showlocalchanges && [commitinview $mainheadid $curview]} {
dodiffindex
}
set oldmainid $mainheadid
rereadrefs
if {$showlocalchanges} {
if {$mainheadid ne $oldmainid} {
dohidelocalchanges
}
if {[commitinview $mainheadid $curview]} {
dodiffindex
}
}
set view $curview
set commits [exec git rev-parse --default HEAD --revs-only \
$viewargs($view)]
Expand Down

0 comments on commit eb5f8c9

Please sign in to comment.