Subject: Re: [PATCH v2 2/5] reftable/stack: refactor reloading to use file descriptor

From: Junio C Hamano <[email-masked]>
Date: Tue, 16 Jan 2024 08:44:17 -0800

Jeff King <[email-masked]> writes:

>> So overall this works as intended, even though I would not consider it
>> to be the cleanest way to handle this. Unless you or others think that
>> this should be refactored I'll leave it as-is for now though.
>
> Thanks for confirming. I think we can leave your patch as-is. If
> anything, I would say that stat_validity_update() should check for "fd <
> 0" itself. Not because I think fstat() is unlikely to behave differently
> on some platform, but simply because it more clearly documents the
> expectation.

Thanks, I agree with your point that we should avoid calling system
functions that take a file descriptor with a known-invalid (like
negative) one.