diff options
| author | Jeff King <peff@peff.net> | 2021-09-24 14:33:00 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-09-27 12:36:44 -0700 |
| commit | e9de7a52a5cb1d6647a33a3ce0eedb947e04f3fc (patch) | |
| tree | 187dd552acbc1b99387df62528d895e3dd09f821 /refs/files-backend.c | |
| parent | b4724242fa3342d939e7a0c4102d3695091db1f6 (diff) | |
t5516: don't use HEAD ref for invalid ref-deletion tests
A few tests in t5516 want to assert that we can delete a corrupted ref
whose pointed-to object is missing. They do so by using the "main"
branch, which is also pointed to by HEAD.
This does work, but only because of a subtle assumption about the
implementation. We do not block the deletion because of the invalid ref,
but we _also_ do not notice that the deleted branch is pointed to by
HEAD. And so the safety rule of "do not allow HEAD to be deleted in a
non-bare repository" does not kick in, and the test passes.
Let's instead use a non-HEAD branch. That still tests what we care about
here (deleting a corrupt ref), but without implicitly depending on our
failure to notice that we're deleting HEAD. That will future proof the
test against that behavior changing.
Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/files-backend.c')
0 files changed, 0 insertions, 0 deletions
