summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-08-23 13:36:05 +0200
committerJunio C Hamano <gitster@pobox.com>2021-08-25 13:27:37 -0700
commit11e984da076eeb2fea46f23f573c18bc197edb34 (patch)
tree1c7abf2607db23cc79b547d823d49e3df00c594a /refs
parent491ad946b29d8938d12aabe0317a0db73dbda2f2 (diff)
downloadgit-11e984da076eeb2fea46f23f573c18bc197edb34.tar.gz
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>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index e73458e257..69f7f54e03 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -915,8 +915,6 @@ static int create_reflock(const char *path, void *cb)
static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
const char *refname,
const struct object_id *old_oid,
- const struct string_list *extras,
- const struct string_list *skip,
int *type, struct strbuf *err)
{
struct strbuf ref_file = STRBUF_INIT;
@@ -949,7 +947,7 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
last_errno = errno;
if (!refs_verify_refname_available(
&refs->base,
- refname, extras, skip, err))
+ refname, NULL, NULL, err))
strbuf_addf(err, "there are still refs under '%s'",
refname);
goto error_return;
@@ -962,7 +960,7 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
last_errno = errno;
if (last_errno != ENOTDIR ||
!refs_verify_refname_available(&refs->base, refname,
- extras, skip, err))
+ NULL, NULL, err))
strbuf_addf(err, "unable to resolve reference '%s': %s",
refname, strerror(last_errno));
@@ -977,7 +975,7 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
*/
if (is_null_oid(&lock->old_oid) &&
refs_verify_refname_available(refs->packed_ref_store, refname,
- extras, skip, err)) {
+ NULL, NULL, err)) {
last_errno = ENOTDIR;
goto error_return;
}
@@ -1412,9 +1410,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
logmoved = log;
-
- lock = lock_ref_oid_basic(refs, newrefname, NULL, NULL, NULL,
- NULL, &err);
+ lock = lock_ref_oid_basic(refs, newrefname, NULL, NULL, &err);
if (!lock) {
if (copy)
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,
goto out;
rollback:
- lock = lock_ref_oid_basic(refs, oldrefname, NULL, NULL, NULL,
- NULL, &err);
+ lock = lock_ref_oid_basic(refs, oldrefname, NULL, NULL, &err);
if (!lock) {
error("unable to lock %s for rollback: %s", oldrefname, err.buf);
strbuf_release(&err);
@@ -1844,9 +1839,7 @@ static int files_create_symref(struct ref_store *ref_store,
struct ref_lock *lock;
int ret;
- lock = lock_ref_oid_basic(refs, refname, NULL,
- NULL, NULL, NULL,
- &err);
+ lock = lock_ref_oid_basic(refs, refname, NULL, NULL, &err);
if (!lock) {
error("%s", err.buf);
strbuf_release(&err);
@@ -3063,8 +3056,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
* reference itself, plus we might need to update the
* reference if --updateref was specified:
*/
- lock = lock_ref_oid_basic(refs, refname, oid,
- NULL, NULL, &type, &err);
+ lock = lock_ref_oid_basic(refs, refname, oid, &type, &err);
if (!lock) {
error("cannot lock ref '%s': %s", refname, err.buf);
strbuf_release(&err);