Am 16.09.22 um 17:55 schrieb Junio C Hamano: > René Scharfe <l.s.r@xxxxxx> writes: > >> The check "i < rev.cmdline.nr" is necessary to avoid segfaults e.g. >> in t0005. I wonder why. Shouldn't rev.pending.objects and >> rev.cmdline.rev always have the same number of entries? > > Things that did not come from command line can go into pending, > can't they? E.g. add_head_to_pending(), when lack of rev defaults > to "HEAD", touches pending without touching cmdline? Indeed. In t0005 it's even only a fake HEAD with an empty_tree added by cmd_diff() a few lines up, for a diff of a new file in a fresh, empty repository. René