notes: make get_note return pointer to struct object_id
Make get_note return a pointer to a const struct object_id. Add a defensive check to ensure we don't accidentally dereference a NULL pointer. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
490bc83a01
commit
9ef7223058
2
notes.h
2
notes.h
@@ -140,7 +140,7 @@ int remove_note(struct notes_tree *t, const unsigned char *object_sha1);
|
||||
*
|
||||
* Return NULL if the given object has no notes.
|
||||
*/
|
||||
const unsigned char *get_note(struct notes_tree *t,
|
||||
const struct object_id *get_note(struct notes_tree *t,
|
||||
const unsigned char *object_sha1);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user