diff options
-rw-r--r-- | notes.c | 7 | ||||
-rw-r--r-- | notes.h | 3 |
2 files changed, 10 insertions, 0 deletions
@@ -105,6 +105,13 @@ static unsigned char *lookup_notes(const unsigned char *commit_sha1) return hash_map.entries[index].notes_sha1; } +void free_notes(void) +{ + free(hash_map.entries); + memset(&hash_map, 0, sizeof(struct hash_map)); + initialized = 0; +} + void get_commit_notes(const struct commit *commit, struct strbuf *sb, const char *output_encoding, int flags) { @@ -1,6 +1,9 @@ #ifndef NOTES_H #define NOTES_H +/* Free (and de-initialize) the internal notes tree structure */ +void free_notes(void); + #define NOTES_SHOW_HEADER 1 #define NOTES_INDENT 2 |