notes: track whether notes_trees were changed at all

Currently, the notes copying is a bit wasteful since it always creates
new trees, even if no notes were copied at all.

Teach add_note() and remove_note() to flag the affected notes tree as
changed ('dirty').  Then teach builtin/notes.c to use this knowledge
and avoid committing trees that weren't changed.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Thomas Rast
2010-03-12 18:04:36 +01:00
committed by Junio C Hamano
parent dcf783a261
commit 7f710ea982
3 changed files with 6 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ extern struct notes_tree {
char *ref;
combine_notes_fn *combine_notes;
int initialized;
int dirty;
} default_notes_tree;
/*