]> asedeno.scripts.mit.edu Git - git.git/blobdiff - notes.h
revert: use strbuf to refactor the code that writes the merge message
[git.git] / notes.h
diff --git a/notes.h b/notes.h
index 20d6e171ff7cb968599295f1399f38b0ede5e594..bad03ccab776d837751803623394667bfd1c7d11 100644 (file)
--- a/notes.h
+++ b/notes.h
@@ -36,6 +36,7 @@ int combine_notes_ignore(unsigned char *cur_sha1, const unsigned char *new_sha1)
  */
 extern struct notes_tree {
        struct int_node *root;
+       struct non_note *first_non_note, *prev_non_note;
        char *ref;
        combine_notes_fn *combine_notes;
        int initialized;
@@ -160,6 +161,18 @@ int for_each_note(struct notes_tree *t, int flags, each_note_fn fn,
  */
 int write_notes_tree(struct notes_tree *t, unsigned char *result);
 
+/*
+ * Remove all notes annotating non-existing objects from the given notes tree
+ *
+ * All notes in the given notes_tree that are associated with objects that no
+ * longer exist in the database, are removed from the notes tree.
+ *
+ * IMPORTANT: The changes made by prune_notes() to the given notes_tree
+ * structure are not persistent until a subsequent call to write_notes_tree()
+ * returns zero.
+ */
+void prune_notes(struct notes_tree *t);
+
 /*
  * Free (and de-initialize) the given notes_tree structure
  *