Re: [PATCH 6/6] revision: add parents after child for ^!
- From
René Scharfe <l.s.r@web.de>
- Date
- Sep 18, 2022, 05:36 UTC
- Message-ID
- <fd323d96-28fc-a362-2f23-d99ccc5ec76c@web.de>
- In-Reply-To
- <xmqqh717jou6.fsf@gitster.g>
Am 16.09.22 um 17:55 schrieb Junio C Hamano:
Show 9 quoted lines
> René Scharfe <l.s.r@web.de> 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é