refs: drop unused "flags" parameter to lock_ref_oid_basic()

In the last commit we removed the REF_DELETING flag from lock_ref_oid_basic(). Since then all of the remaining callers do pass REF_NO_DEREF, but that has been ignored completely since 7a418f3a17 (lock_ref_sha1_basic(): only handle REF_NODEREF mode, 2016-04-22). So we can simply get rid of the parameter entirely. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Aug 23, 2021 at 13:36 UTC 491ad946b29d8938d12aabe0317a0db73dbda2f2
1 file changed +6 -7
refs/files-backend.c
+6 -7
@@ -917,8 +917,7 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
917 const struct object_id *old_oid,
918 const struct string_list *extras,
919 const struct string_list *skip,
920 - unsigned int flags, int *type,
921 - struct strbuf *err)
920 + int *type, struct strbuf *err)
921 {
922 struct strbuf ref_file = STRBUF_INIT;
923 struct ref_lock *lock;
@@ -1413,8 +1412,9 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
1412
1413 logmoved = log;
1414
1415 +
1416 lock = lock_ref_oid_basic(refs, newrefname, NULL, NULL, NULL,
1417 - REF_NO_DEREF, NULL, &err);
1417 + NULL, &err);
1418 if (!lock) {
1419 if (copy)
1420 error("unable to copy '%s' to '%s': %s", oldrefname, newrefname, err.buf);
@@ -1437,7 +1437,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
1437
1438 rollback:
1439 lock = lock_ref_oid_basic(refs, oldrefname, NULL, NULL, NULL,
1440 - REF_NO_DEREF, NULL, &err);
1440 + NULL, &err);
1441 if (!lock) {
1442 error("unable to lock %s for rollback: %s", oldrefname, err.buf);
1443 strbuf_release(&err);
@@ -1845,7 +1845,7 @@ static int files_create_symref(struct ref_store *ref_store,
1845 int ret;
1846
1847 lock = lock_ref_oid_basic(refs, refname, NULL,
1848 - NULL, NULL, REF_NO_DEREF, NULL,
1848 + NULL, NULL, NULL,
1849 &err);
1850 if (!lock) {
1851 error("%s", err.buf);
@@ -3064,8 +3064,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
3064 * reference if --updateref was specified:
3065 */
3066 lock = lock_ref_oid_basic(refs, refname, oid,
3067 - NULL, NULL, REF_NO_DEREF,
3068 - &type, &err);
3067 + NULL, NULL, &type, &err);
3068 if (!lock) {
3069 error("cannot lock ref '%s': %s", refname, err.buf);
3070 strbuf_release(&err);