MCPcopy Index your code
hub / github.com/git/git / note_tree_find

Function note_tree_find

notes.c:149–160  ·  view source on GitHub ↗

* To find a leaf_node: * Search to the tree location appropriate for the given key: * If a note entry with matching key, return the note entry, else return NULL. */

Source from the content-addressed store, hash-verified

147 * If a note entry with matching key, return the note entry, else return NULL.
148 */
149static struct leaf_node *note_tree_find(struct notes_tree *t,
150 struct int_node *tree, unsigned char n,
151 const unsigned char *key_sha1)
152{
153 void **p = note_tree_search(t, &tree, &n, key_sha1);
154 if (GET_PTR_TYPE(*p) == PTR_TYPE_NOTE) {
155 struct leaf_node *l = (struct leaf_node *) CLR_PTR_TYPE(*p);
156 if (hasheq(key_sha1, l->key_oid.hash, the_repository->hash_algo))
157 return l;
158 }
159 return NULL;
160}
161
162/*
163 * How to consolidate an int_node:

Callers 1

get_noteFunction · 0.85

Calls 2

note_tree_searchFunction · 0.85
hasheqFunction · 0.85

Tested by

no test coverage detected