Re: [PATCH 1/4] wt-status: read HEAD and ORIG_HEAD via the refdb
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Nov 30, 2023, 17:36 UTC
- Message-ID
- <ZWjIH9sj5cI8OBLq@nand.local>
- In-Reply-To
- <ZWg8-HW6yCa6-tnS@tanuki>
On Thu, Nov 30, 2023 at 08:42:48AM +0100, Patrick Steinhardt wrote:
Show 13 quoted lines
> > Are there any other gotchas that we should be thinking about? > > Not that I can think of. As you say, a repository with malformed HEAD > will run into other problems anyway. And `read_ref_full()` would return > errors if these refs were malformed, which would cause us to exit early > from anyway. So unless "rebase-merge/amend" and "rebase-merge/orig-head" > contained the same kind of garbage we'd retain the same behaviour as > before, and that shouldn't really be happening. > > One interesting bit is that we don't set `RESOLVE_REF_READING`, so > `read_ref_full()` may return successfully even if the ref doesn't exist. > But in practice this is fine given that the resulting oid would be > cleared in that case.
Thanks for thinking through these. I agree with your reasoning and think that this is fine as-is.
(Off-topic, but can you please trim your replies to only include the quoted parts/context that you're replying to?)
Thanks, Taylor