refs: add an update_ref_oid function.
Several places around the codebase want to pass update_ref data from struct object_id, but update_ref may also be passed NULL pointers. Instead of checking and dereferencing in every caller, create an update_ref_oid which wraps update_ref and provides this functionality. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
151b2911c1
commit
8f6dc7e32e
3
refs.h
3
refs.h
@ -477,6 +477,9 @@ void ref_transaction_free(struct ref_transaction *transaction);
|
||||
int update_ref(const char *msg, const char *refname,
|
||||
const unsigned char *new_sha1, const unsigned char *old_sha1,
|
||||
unsigned int flags, enum action_on_err onerr);
|
||||
int update_ref_oid(const char *msg, const char *refname,
|
||||
const struct object_id *new_oid, const struct object_id *old_oid,
|
||||
unsigned int flags, enum action_on_err onerr);
|
||||
|
||||
int parse_hide_refs_config(const char *var, const char *value, const char *);
|
||||
|
||||
|
Reference in New Issue
Block a user