Subject: Re: [PATCHv3 6/6] refs.c: enable large transactions

From: Junio C Hamano <[email-masked]>
Date: Mon, 26 Jan 2015 19:17:07 -0800

Stefan Beller <[email-masked]> writes:

> I do not see the problem in the code itself, but rather in understanding
> the code. I will send a follow up patch which makes it easier to follow
> by removing the early exit with no problem away.

Taken as a whole the code may function correctly but the division of
roles of individual functions seems screwed up.  write_ref_sha1()
sometimes unlocks, and sometimes leaves the unlocking to the caller,
and the caller cannot even tell if it is expected to do the unlocking
for it from the return value because both cases return 0 (success).

I am not sure if it is sensible to call that "correct but hard to
understand".  I'd rather see us admit that its behaviour is screwey
and needs fixing for better code health longer term.