refs: introduce REF_SKIP_REFNAME_VERIFICATION flag
Use this flag with the test-helper in t1430, to avoid direct writes to the ref database. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
e9706a188f
commit
3c966c7b4e
7
refs.c
7
refs.c
@ -1083,9 +1083,10 @@ int ref_transaction_update(struct ref_transaction *transaction,
|
||||
{
|
||||
assert(err);
|
||||
|
||||
if ((new_oid && !is_null_oid(new_oid)) ?
|
||||
check_refname_format(refname, REFNAME_ALLOW_ONELEVEL) :
|
||||
!refname_is_safe(refname)) {
|
||||
if (!(flags & REF_SKIP_REFNAME_VERIFICATION) &&
|
||||
((new_oid && !is_null_oid(new_oid)) ?
|
||||
check_refname_format(refname, REFNAME_ALLOW_ONELEVEL) :
|
||||
!refname_is_safe(refname))) {
|
||||
strbuf_addf(err, _("refusing to update ref with bad name '%s'"),
|
||||
refname);
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user