Re: [PATCH v3 19/19] delete_ref(): use the usual convention for old_sha1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:

> The ref_transaction_update() family of functions use the following
> convention for their old_sha1 parameters:
>
> * old_sha1 == NULL: Don't check the old value at all.
> * is_null_sha1(old_sha1): Ensure that the reference didn't exist
>   before the transaction.
> * otherwise: Ensure that the reference had the specified value before
>   the transaction.
>
> delete_ref() had a different convention, namely treating
> is_null_sha1(old_sha1) as "don't care". Change it to adhere to the
> standard convention to reduce the scope for confusion.
>
> Please note that it is now a bug to pass old_sha1=NULL_SHA1 to
> delete_ref() (because it doesn't make sense to delete a reference that
> you already know doesn't exist). This is consistent with the behavior
> of ref_transaction_delete().

Nice.

Everything I read in this round of changes makes sense (except for
the ones I had minor comments on, which were separately sent).

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]