Re: [PATCH v2 3/7] update-ref: add support for symref-delete

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

 



Christian Couder <christian.couder@xxxxxxxxx> writes:

> On Fri, Apr 12, 2024 at 11:59 AM Karthik Nayak <karthik.188@xxxxxxxxx> wrote:
>>
>> From: Karthik Nayak <karthik.188@xxxxxxxxx>
>>
>> Similar to the previous commit, add 'symref-delete' to allow deletions
>> of symbolic refs in a transaction via the 'git-update-ref' command. The
>> 'symref-delete' command can when given with an <old-ref>, deletes the
>> provided <ref> only when it points to <old-ref>.
>
> I have a similar question as with the previous patch about what
> happens if <old-ref> looks like an oid and <ref> is a regular ref
> pointing to it.
>

We parse refs passed as <old-ref> and this would fail.

>> Signed-off-by: Karthik Nayak <karthik.188@xxxxxxxxx>
>
>> diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt
>> index 749aaa7892..ef22a1a2f4 100644
>> --- a/Documentation/git-update-ref.txt
>> +++ b/Documentation/git-update-ref.txt
>> @@ -65,6 +65,7 @@ performs all modifications together.  Specify commands of the form:
>>         create SP <ref> SP <new-oid> LF
>>         delete SP <ref> [SP <old-oid>] LF
>>         verify SP <ref> [SP <old-oid>] LF
>> +       symref-delete SP <ref> [SP <old-ref>] LF
>>         symref-verify SP <ref> [SP <old-ref>] LF
>>         option SP <opt> LF
>>         start LF
>> @@ -87,6 +88,7 @@ quoting:
>>         create SP <ref> NUL <new-oid> NUL
>>         delete SP <ref> NUL [<old-oid>] NUL
>>         verify SP <ref> NUL [<old-oid>] NUL
>> +       symref-delete SP <ref> [NUL <old-ref>] NUL
>>         symref-verify SP <ref> [NUL <old-ref>] NUL
>>         option SP <opt> NUL
>>         start NUL
>
> Also I wonder if there is a test where <old-ref> is an empty string, so where:
>
>     symref-delete SP <ref> SP LF
>
> or:
>
>     symref-delete SP <ref> NUL NUL
>
> are used?

I didn't add such tests, will add.

Attachment: signature.asc
Description: PGP signature


[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]

  Powered by Linux