]> git.ipfire.org Git - thirdparty/git.git/commit
refs: specify error for regular refs with `old_target`
authorKarthik Nayak <karthik.188@gmail.com>
Fri, 7 Jun 2024 13:32:59 +0000 (15:32 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Jun 2024 17:25:44 +0000 (10:25 -0700)
commitaa6e99f1226fe46f1649f48d020011e19556e8e1
tree3c833c0d5dcc3d24b66d4babcdc25a65c2a42cf0
parentaba381c09034c2c31f3476e8cc9a46ea6889f1d5
refs: specify error for regular refs with `old_target`

When a reference update tries to update a symref, but the ref in
question is actually a regular ref, we raise an error. However the error
raised in this situation is:

  verifying symref target: '<ref>': reference is missing but expected <old-target>

which is very generic and doesn't indicate the mismatch of types. Let's
make this error more specific:

  cannot lock ref '<ref>': expected symref with target '<old-target>': but is a regular ref

so that users have a clearer understanding.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
refs/reftable-backend.c