gitk: Fix compare-commits function when we have local changes