Re: [PATCH] refs: sync loose refs to disk before committing them
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 5, 2021, 01:40 UTC
- Message-ID
- <xmqqfssbz8ft.fsf@gitster.g>
- In-Reply-To
- <20211104223600.GA4069@neerajsi-x1.localdomain>
Neeraj Singh <nksingh85@gmail.com> writes:
> Is there some reason we shouldn't die if writing the ref fails? We are > already accustomed to dying if fsyncing a packfile or the index fails.
If we look at the surrounding code and the callers of the function, this caller of fsync() is about to signal a failure to its callers by returning an error(). The callers are prepared to see an error and cope with it.
Introducing die() to such a library-ish part of the code deep in the callchain is not exactly a good change, especially when it is obvious how we can avoid it.