refs API: make refs_rename_ref_available() static
Move the refs_rename_ref_available() function into
"refs/files-backend.c". It is file-backend specific.
This function was added in 5fe7d825da (refs.c: pass a list of names
to skip to is_refname_available, 2014-05-01) as rename_ref_available()
and was only ever used in this one file-backend specific codepath. So
let's move it there.
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
df3458e957
commit
c339ff690f
19
refs.c
19
refs.c
@ -1372,25 +1372,6 @@ const char *find_descendant_ref(const char *dirname,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int refs_rename_ref_available(struct ref_store *refs,
|
||||
const char *old_refname,
|
||||
const char *new_refname)
|
||||
{
|
||||
struct string_list skip = STRING_LIST_INIT_NODUP;
|
||||
struct strbuf err = STRBUF_INIT;
|
||||
int ok;
|
||||
|
||||
string_list_insert(&skip, old_refname);
|
||||
ok = !refs_verify_refname_available(refs, new_refname,
|
||||
NULL, &skip, &err);
|
||||
if (!ok)
|
||||
error("%s", err.buf);
|
||||
|
||||
string_list_clear(&skip, 0);
|
||||
strbuf_release(&err);
|
||||
return ok;
|
||||
}
|
||||
|
||||
int refs_head_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
|
||||
{
|
||||
struct object_id oid;
|
||||
|
||||
Reference in New Issue
Block a user