Re: [PATCH v2 5/6] lock_ref_for_update(): make error handling more uniform

2016-06-13 Thread Michael Haggerty
On 06/13/2016 09:16 AM, Michael Haggerty wrote: > On 06/10/2016 09:01 PM, David Turner wrote: >> On Fri, 2016-06-10 at 10:14 +0200, Michael Haggerty wrote: >> >>> /* >>> + * Check whether the REF_HAVE_OLD and old_oid values stored in update >>> + * are consistent with the result read for the

Re: [PATCH v2 5/6] lock_ref_for_update(): make error handling more uniform

2016-06-13 Thread Michael Haggerty
On 06/10/2016 09:01 PM, David Turner wrote: > On Fri, 2016-06-10 at 10:14 +0200, Michael Haggerty wrote: > >> /* >> + * Check whether the REF_HAVE_OLD and old_oid values stored in update >> + * are consistent with the result read for the reference. error is >> + * true iff there was an error

Re: [PATCH v2 5/6] lock_ref_for_update(): make error handling more uniform

2016-06-10 Thread David Turner
On Fri, 2016-06-10 at 10:14 +0200, Michael Haggerty wrote: > /* > + * Check whether the REF_HAVE_OLD and old_oid values stored in update > + * are consistent with the result read for the reference. error is > + * true iff there was an error reading the reference; otherwise, oid "error" is not a

[PATCH v2 5/6] lock_ref_for_update(): make error handling more uniform

2016-06-10 Thread Michael Haggerty
To aid the effort, extract a new function, check_old_oid(), and use it in the two places where the read value of the reference has to be checked against update->old_sha1. Update tests to reflect the improvements. Signed-off-by: Michael Haggerty --- refs/files-backend.c