]> git.ipfire.org Git - thirdparty/git.git/commit - refs/files-backend.c
refs/files: remove unused "oid" in lock_ref_oid_basic()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 23 Aug 2021 11:36:12 +0000 (13:36 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Aug 2021 20:27:37 +0000 (13:27 -0700)
commitff7a2e4dbb0cf3844fbd0fbab7fba95d8e47c8dd
treeaf0db96c89f886ce20786656ad1e71d621eb1c91
parentcc40b5ce137d0189aa52ab4c3d5ad3957342da5a
refs/files: remove unused "oid" in lock_ref_oid_basic()

In the preceding commit the last caller that passed a non-NULL OID was
changed to pass NULL to lock_ref_oid_basic(). As noted in preceding
commits use of this API has been going away (we should use ref
transactions, or lock_raw_ref()), so we're unlikely to gain new
callers that want to pass the "oid".

So let's remove it, doing so means we can remove the "mustexist"
condition, and therefore anything except the "flags =
RESOLVE_REF_NO_RECURSE" case.

Furthermore, since the verify_lock() function we called did most of
its work when the "oid" was passed (as "old_oid") we can inline the
trivial part of it that remains in its only remaining caller. Without
a NULL "oid" passed it was equivalent to calling refs_read_ref_full()
followed by oidclr().

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c