Re: [PATCH v4 2/5] builtin/refs: add "delete" subcommand
- From
Toon Claes <toon@iotcl.com>
- Date
- Jul 9, 2026, 09:44 UTC
- Message-ID
- <874ii8o5tx.fsf@emacs.iotcl.com>
- In-Reply-To
- <20260706-pks-refs-writing-subcommands-v4-2-d51f6ce7f830@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 17 quoted lines
> +test_expect_success 'delete symref with --no-deref verifies target OID' ' > + test_when_finished "rm -rf repo" && > + setup_repo repo && > + ( > + cd repo && > + A=$(git rev-parse A) && > + B=$(git rev-parse B) && > + git update-ref refs/heads/foo $A && > + git symbolic-ref refs/heads/symref refs/heads/foo && > + > + test_must_fail git refs delete --no-deref refs/heads/symref $B && > + git refs exists refs/heads/symref && > + > + git refs delete --no-deref refs/heads/symref $A && > + test_must_fail git refs exists refs/heads/symref && > + git refs exists refs/heads/foo > + )
So with --no-deref it still checks the dererenced OID, not the target ref? I expected it to work like this:
test_expect_success 'delete symref with --no-deref verifies target ref' '
test_when_finished "rm -rf repo" &&
setup_repo repo &&
(
cd repo &&
A=$(git rev-parse A) &&
B=$(git rev-parse B) &&
git update-ref refs/heads/foo $A &&
git symbolic-ref refs/heads/symref refs/heads/foo && test_must_fail git refs delete --no-deref refs/heads/symref refs/heads/bar &&
git refs exists refs/heads/symref && git refs delete --no-deref refs/heads/symref refs/heads/foo &&
test_must_fail git refs exists refs/heads/symref &&
git refs exists refs/heads/foo
)-- Cheers, Toon