aboutsummaryrefslogtreecommitdiff
path: root/notes.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-13 11:22:39 -0700
committerJunio C Hamano <gitster@pobox.com>2010-06-13 11:22:39 -0700
commit2d4fef9b86f41ad929f533e0e52dc1a6048cc2a3 (patch)
tree892c4c4b0194c611899f6d3c2c2fcfd8a346a974 /notes.c
parentcde3eadad2fcacc90792a31d0c2ed6890f373e63 (diff)
parenta9f2adff802308481f2e638bae0c5b6e205251a3 (diff)
downloadgit-2d4fef9b86f41ad929f533e0e52dc1a6048cc2a3.tar.xz
Merge branch 'mg/notes-dry-run'
* mg/notes-dry-run: notes: dry-run and verbose options for prune
Diffstat (limited to 'notes.c')
-rw-r--r--notes.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/notes.c b/notes.c
index e425e19827..6ee04e79e9 100644
--- a/notes.c
+++ b/notes.c
@@ -1083,7 +1083,7 @@ int write_notes_tree(struct notes_tree *t, unsigned char *result)
return ret;
}
-void prune_notes(struct notes_tree *t)
+void prune_notes(struct notes_tree *t, int flags)
{
struct note_delete_list *l = NULL;
@@ -1094,7 +1094,10 @@ void prune_notes(struct notes_tree *t)
for_each_note(t, 0, prune_notes_helper, &l);
while (l) {
- remove_note(t, l->sha1);
+ if (flags & NOTES_PRUNE_VERBOSE)
+ printf("%s\n", sha1_to_hex(l->sha1));
+ if (!(flags & NOTES_PRUNE_DRYRUN))
+ remove_note(t, l->sha1);
l = l->next;
}
}