Re: [PATCH 11/11] read-cache: roll back lock on error with `COMMIT_LOCK`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 2, 2017, 04:01 UTC
- Message-ID
- <xmqq60byqjtr.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <26a9c90a6478ec9ddb4ce34923e251ebe9323ab2.1506862824.git.martin.agren@gmail.com>
Martin Ågren <martin.agren@gmail.com> writes:
Show 5 quoted lines
> Teach `write_locked_index(..., COMMIT_LOCK)` to roll back the lock > before returning. If we have already succeeded and committed, it will be > a noop. Simplify the existing callers where we now have a superfluous > call to `rollback_lockfile()`. This should keep future readers from > wondering why the callers are inconsistent.
Makes sense. Thanks for cleaning up. The split-index codepath was something I've never reviewed seriously with fine toothed comb, and I feel a lot better now knowing that somebody other than its authors and me have read it through ;-)