gitk: Fix bug in the anc_or_desc routine