refs/files: remove unused "extras/skip" in lock_ref_oid_basic()
The lock_ref_oid_basic() function has gradually been replaced by use of the file transaction API, there are only 4 remaining callers of it. None of those callers pass non-NULL "extras" and "skip" parameters, the last such caller went away in 92b1551b1d4 (refs: resolve symbolic refs first, 2016-04-25), so let's remove the parameters. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Aug 23, 2021 at 13:36 UTC
11e984da076eeb2fea46f23f573c18bc197edb34
1 file changed
+7
-15
refs/files-backend.c
+7
-15
@@ -915,8 +915,6 @@ static int create_reflock(const char *path, void *cb)
915
static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
916
const char *refname,
917
const struct object_id *old_oid,
918
- const struct string_list *extras,
919
- const struct string_list *skip,
918
int *type, struct strbuf *err)
919
{
920
struct strbuf ref_file = STRBUF_INIT;
@@ -949,7 +947,7 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
947
last_errno = errno;
948
if (!refs_verify_refname_available(
949
&refs->base,
952
- refname, extras, skip, err))
950
+ refname, NULL, NULL, err))
951
strbuf_addf(err, "there are still refs under '%s'",
952
refname);
953
goto error_return;
@@ -962,7 +960,7 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
960
last_errno = errno;
961
if (last_errno != ENOTDIR ||
962
!refs_verify_refname_available(&refs->base, refname,
965
- extras, skip, err))
963
+ NULL, NULL, err))
964
strbuf_addf(err, "unable to resolve reference '%s': %s",
965
refname, strerror(last_errno));
966
@@ -977,7 +975,7 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
975
*/
976
if (is_null_oid(&lock->old_oid) &&
977
refs_verify_refname_available(refs->packed_ref_store, refname,
980
- extras, skip, err)) {
978
+ NULL, NULL, err)) {
979
last_errno = ENOTDIR;
980
goto error_return;
981
}
@@ -1412,9 +1410,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
1410
1411
logmoved = log;
1412
1415
-
1416
- lock = lock_ref_oid_basic(refs, newrefname, NULL, NULL, NULL,
1417
- NULL, &err);
1413
+ lock = lock_ref_oid_basic(refs, newrefname, NULL, NULL, &err);
1414
if (!lock) {
1415
if (copy)
1416
error("unable to copy '%s' to '%s': %s", oldrefname, newrefname, err.buf);
@@ -1436,8 +1432,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
1432
goto out;
1433
1434
rollback:
1439
- lock = lock_ref_oid_basic(refs, oldrefname, NULL, NULL, NULL,
1440
- NULL, &err);
1435
+ lock = lock_ref_oid_basic(refs, oldrefname, NULL, NULL, &err);
1436
if (!lock) {
1437
error("unable to lock %s for rollback: %s", oldrefname, err.buf);
1438
strbuf_release(&err);
@@ -1844,9 +1839,7 @@ static int files_create_symref(struct ref_store *ref_store,
1839
struct ref_lock *lock;
1840
int ret;
1841
1847
- lock = lock_ref_oid_basic(refs, refname, NULL,
1848
- NULL, NULL, NULL,
1849
- &err);
1842
+ lock = lock_ref_oid_basic(refs, refname, NULL, NULL, &err);
1843
if (!lock) {
1844
error("%s", err.buf);
1845
strbuf_release(&err);
@@ -3063,8 +3056,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
3056
* reference itself, plus we might need to update the
3057
* reference if --updateref was specified:
3058
*/
3066
- lock = lock_ref_oid_basic(refs, refname, oid,
3067
- NULL, NULL, &type, &err);
3059
+ lock = lock_ref_oid_basic(refs, refname, oid, &type, &err);
3060
if (!lock) {
3061
error("cannot lock ref '%s': %s", refname, err.buf);
3062
strbuf_release(&err);