refs: report ref type from lock_any_ref_for_update
Expose lock_ref_sha1_basic's type_p argument to callers of lock_any_ref_for_update. Update all call sites to ignore it by passing NULL for now. Signed-off-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
2be778a8ac
commit
9bbb0fa1fd
7
refs.c
7
refs.c
@ -2121,11 +2121,12 @@ struct ref_lock *lock_ref_sha1(const char *refname, const unsigned char *old_sha
|
||||
}
|
||||
|
||||
struct ref_lock *lock_any_ref_for_update(const char *refname,
|
||||
const unsigned char *old_sha1, int flags)
|
||||
const unsigned char *old_sha1,
|
||||
int flags, int *type_p)
|
||||
{
|
||||
if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL))
|
||||
return NULL;
|
||||
return lock_ref_sha1_basic(refname, old_sha1, flags, NULL);
|
||||
return lock_ref_sha1_basic(refname, old_sha1, flags, type_p);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3174,7 +3175,7 @@ int update_ref(const char *action, const char *refname,
|
||||
int flags, enum action_on_err onerr)
|
||||
{
|
||||
static struct ref_lock *lock;
|
||||
lock = lock_any_ref_for_update(refname, oldval, flags);
|
||||
lock = lock_any_ref_for_update(refname, oldval, flags, NULL);
|
||||
if (!lock) {
|
||||
const char *str = "Cannot lock the ref '%s'.";
|
||||
switch (onerr) {
|
||||
|
Reference in New Issue
Block a user