Re: [PATCH 03/26] t1400: Pass a legitimate <newvalue> to update command
- From
Brad King <brad.king@kitware.com>
- Date
- Mar 10, 2014, 17:03 UTC
- Message-ID
- <531DF079.9050909@kitware.com>
- In-Reply-To
- <1394455603-2968-4-git-send-email-mhagger@alum.mit.edu>
On 03/10/2014 08:46 AM, Michael Haggerty wrote:
Show 8 quoted lines
> This test is trying to test a few ways to delete references using "git > update-ref -z --stdin". The third line passed in is > > update SP /refs/heads/c NUL NUL <sha1> NUL > > , which is not a correct way to delete a reference according to the > documentation (the new value should be zeros, not empty). Pass zeros > instead as the new value to test the code correctly.
In my original work on this feature, an empty <newvalue> is allowed. Since newvalue is not optional an empty value can be treated as zero. The relevant documentation is:
update::
Set <ref> to <newvalue> after verifying <oldvalue>, if given.
Specify a zero <newvalue> to ensure the ref does not exist...
Use 40 "0" or the empty string to specify a zero value, except that with `-z` an empty <oldvalue> is considered missing.
The two together say that <newvalue> can be the empty string instead of a literal zero.
-Brad