Re: [PATCH v2 3/7] update-ref: add support for symref-delete
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Apr 18, 2024, 14:52 UTC
- Message-ID
- <CAP8UFD1Fwq4exKKz3kyJiwcgtOe4TjQ938C=sAbdWOTsw6241A@mail.gmail.com>
- In-Reply-To
- <20240412095908.1134387-4-knayak@gitlab.com>
On Fri, Apr 12, 2024 at 11:59 AM Karthik Nayak <karthik.188@gmail.com> wrote:
Show 7 quoted lines
> > From: Karthik Nayak <karthik.188@gmail.com> > > 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.
> Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Show 20 quoted lines
> 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?