summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 709f79b)
raw | patch | inline | side by side (parent: 709f79b)
author | Johan Herland <johan@herland.net> | |
Sat, 13 Feb 2010 21:28:13 +0000 (22:28 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 14 Feb 2010 03:36:12 +0000 (19:36 -0800) |
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
notes.c | patch | blob | history | |
notes.h | patch | blob | history |
index 3f4ae3534043798be86fcaa478246727bbbf4e1d..2c0d14ed8f949f1795d0a7604e76e4dde32ff186 100644 (file)
--- a/notes.c
+++ b/notes.c
load_subtree(&root_tree, &root_node, 0);
}
+void add_note(const unsigned char *object_sha1, const unsigned char *note_sha1)
+{
+ struct leaf_node *l;
+
+ assert(initialized);
+ l = (struct leaf_node *) xmalloc(sizeof(struct leaf_node));
+ hashcpy(l->key_sha1, object_sha1);
+ hashcpy(l->val_sha1, note_sha1);
+ note_tree_insert(&root_node, 0, l, PTR_TYPE_NOTE);
+}
+
static unsigned char *lookup_notes(const unsigned char *object_sha1)
{
struct leaf_node *found = note_tree_find(&root_node, 0, object_sha1);
index 6b527991b01a714784f0184e250fff96944724dc..5f2285217e994e1bf6fec2a0fa651a8aff417a93 100644 (file)
--- a/notes.h
+++ b/notes.h
*/
void init_notes(const char *notes_ref, int flags);
+/* Add the given note object to the internal notes tree structure */
+void add_note(const unsigned char *object_sha1,
+ const unsigned char *note_sha1);
+
/* Free (and de-initialize) the internal notes tree structure */
void free_notes(void);