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 92b1551b1d (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>
This commit is contained in:
committed by
Junio C Hamano
parent
491ad946b2
commit
11e984da07
@ -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,
|
static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
|
||||||
const char *refname,
|
const char *refname,
|
||||||
const struct object_id *old_oid,
|
const struct object_id *old_oid,
|
||||||
const struct string_list *extras,
|
|
||||||
const struct string_list *skip,
|
|
||||||
int *type, struct strbuf *err)
|
int *type, struct strbuf *err)
|
||||||
{
|
{
|
||||||
struct strbuf ref_file = STRBUF_INIT;
|
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;
|
last_errno = errno;
|
||||||
if (!refs_verify_refname_available(
|
if (!refs_verify_refname_available(
|
||||||
&refs->base,
|
&refs->base,
|
||||||
refname, extras, skip, err))
|
refname, NULL, NULL, err))
|
||||||
strbuf_addf(err, "there are still refs under '%s'",
|
strbuf_addf(err, "there are still refs under '%s'",
|
||||||
refname);
|
refname);
|
||||||
goto error_return;
|
goto error_return;
|
||||||
@ -962,7 +960,7 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,
|
|||||||
last_errno = errno;
|
last_errno = errno;
|
||||||
if (last_errno != ENOTDIR ||
|
if (last_errno != ENOTDIR ||
|
||||||
!refs_verify_refname_available(&refs->base, refname,
|
!refs_verify_refname_available(&refs->base, refname,
|
||||||
extras, skip, err))
|
NULL, NULL, err))
|
||||||
strbuf_addf(err, "unable to resolve reference '%s': %s",
|
strbuf_addf(err, "unable to resolve reference '%s': %s",
|
||||||
refname, strerror(last_errno));
|
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) &&
|
if (is_null_oid(&lock->old_oid) &&
|
||||||
refs_verify_refname_available(refs->packed_ref_store, refname,
|
refs_verify_refname_available(refs->packed_ref_store, refname,
|
||||||
extras, skip, err)) {
|
NULL, NULL, err)) {
|
||||||
last_errno = ENOTDIR;
|
last_errno = ENOTDIR;
|
||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
@ -1412,9 +1410,7 @@ static int files_copy_or_rename_ref(struct ref_store *ref_store,
|
|||||||
|
|
||||||
logmoved = log;
|
logmoved = log;
|
||||||
|
|
||||||
|
lock = lock_ref_oid_basic(refs, newrefname, NULL, NULL, &err);
|
||||||
lock = lock_ref_oid_basic(refs, newrefname, NULL, NULL, NULL,
|
|
||||||
NULL, &err);
|
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
if (copy)
|
if (copy)
|
||||||
error("unable to copy '%s' to '%s': %s", oldrefname, newrefname, err.buf);
|
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;
|
goto out;
|
||||||
|
|
||||||
rollback:
|
rollback:
|
||||||
lock = lock_ref_oid_basic(refs, oldrefname, NULL, NULL, NULL,
|
lock = lock_ref_oid_basic(refs, oldrefname, NULL, NULL, &err);
|
||||||
NULL, &err);
|
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
error("unable to lock %s for rollback: %s", oldrefname, err.buf);
|
error("unable to lock %s for rollback: %s", oldrefname, err.buf);
|
||||||
strbuf_release(&err);
|
strbuf_release(&err);
|
||||||
@ -1844,9 +1839,7 @@ static int files_create_symref(struct ref_store *ref_store,
|
|||||||
struct ref_lock *lock;
|
struct ref_lock *lock;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
lock = lock_ref_oid_basic(refs, refname, NULL,
|
lock = lock_ref_oid_basic(refs, refname, NULL, NULL, &err);
|
||||||
NULL, NULL, NULL,
|
|
||||||
&err);
|
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
error("%s", err.buf);
|
error("%s", err.buf);
|
||||||
strbuf_release(&err);
|
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 itself, plus we might need to update the
|
||||||
* reference if --updateref was specified:
|
* reference if --updateref was specified:
|
||||||
*/
|
*/
|
||||||
lock = lock_ref_oid_basic(refs, refname, oid,
|
lock = lock_ref_oid_basic(refs, refname, oid, &type, &err);
|
||||||
NULL, NULL, &type, &err);
|
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
error("cannot lock ref '%s': %s", refname, err.buf);
|
error("cannot lock ref '%s': %s", refname, err.buf);
|
||||||
strbuf_release(&err);
|
strbuf_release(&err);
|
||||||
|
|||||||
Reference in New Issue
Block a user