Re: [PATCH v2 01/12] sha1_file: do not leak `lock_file`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 6, 2017, 01:17 UTC
- Message-ID
- <xmqqtvzdyszw.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <7f9a7a5d57bf76925e14111efdabe77f1c946e8d.1507228170.git.martin.agren@gmail.com>
Martin Ågren <martin.agren@gmail.com> writes:
Show 10 quoted lines
> Bump `found` to the scope of the whole function and rearrange the "roll > back or write?"-checks to a straightforward if-else on `found`. This > also future-proves the code by making it obvious that we intend to take > exactly one of these paths. > > Improved-by: Jeff King <peff@peff.net> > Signed-off-by: Martin Ågren <martin.agren@gmail.com> > --- > v2: Moved the rollback to the end to have an obvious if-else instead of > retaining the original logic. Thanks Peff.
Yup, both are correct but this version is 10x easier to follow. Thanks, both.