зеркало из https://github.com/microsoft/git.git
gitk: Don't try to show local changes from a head that isn't shown
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>
This commit is contained in:
Родитель
fc2a256f4a
Коммит
eb5f8c9c00
13
gitk
13
gitk
|
@ -170,11 +170,18 @@ proc updatecommits {} {
|
||||||
global curview viewargs viewfiles viewincl viewinstances
|
global curview viewargs viewfiles viewincl viewinstances
|
||||||
global viewactive viewcomplete loginstance tclencoding mainheadid
|
global viewactive viewcomplete loginstance tclencoding mainheadid
|
||||||
global varcid startmsecs commfd showneartags showlocalchanges leftover
|
global varcid startmsecs commfd showneartags showlocalchanges leftover
|
||||||
|
global mainheadid
|
||||||
|
|
||||||
if {$showlocalchanges && [commitinview $mainheadid $curview]} {
|
set oldmainid $mainheadid
|
||||||
dodiffindex
|
|
||||||
}
|
|
||||||
rereadrefs
|
rereadrefs
|
||||||
|
if {$showlocalchanges} {
|
||||||
|
if {$mainheadid ne $oldmainid} {
|
||||||
|
dohidelocalchanges
|
||||||
|
}
|
||||||
|
if {[commitinview $mainheadid $curview]} {
|
||||||
|
dodiffindex
|
||||||
|
}
|
||||||
|
}
|
||||||
set view $curview
|
set view $curview
|
||||||
set commits [exec git rev-parse --default HEAD --revs-only \
|
set commits [exec git rev-parse --default HEAD --revs-only \
|
||||||
$viewargs($view)]
|
$viewargs($view)]
|
||||||
|
|
Загрузка…
Ссылка в новой задаче