summary refs log tree commit diff
path: root/tmp-objdir.h
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2022-02-02 02:37:29 +0000
committerJunio C Hamano <gitster@pobox.com>2022-02-02 10:02:27 -0800
commit7b90ab467a658b2fb1b7c15c7d634e06f35f4ef2 (patch)
tree223e2be7ced848f782226bc6bd984f065f0cf546 /tmp-objdir.h
parentdb757e8b8d5527c195c461a04ec35d141ddea48e (diff)
log: clean unneeded objects during `log --remerge-diff`
The --remerge-diff option will need to create new blobs and trees
representing the "automatic merge" state.  If one is traversing a
long project history, one can easily get hundreds of thousands of
loose objects generated during `log --remerge-diff`.  However, none of
those loose objects are needed after we have completed our diff
operation; they can be summarily deleted.

Add a new helper function to tmp_objdir to discard all the contained
objects, and call it after each merge is handled.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tmp-objdir.h')
-rw-r--r--tmp-objdir.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tmp-objdir.h b/tmp-objdir.h
index cda5ec7677..76efc7edee 100644
--- a/tmp-objdir.h
+++ b/tmp-objdir.h
@@ -47,6 +47,12 @@ int tmp_objdir_migrate(struct tmp_objdir *);
 int tmp_objdir_destroy(struct tmp_objdir *);
 
 /*
+ * Remove all objects from the temporary object directory, while leaving it
+ * around so more objects can be added.
+ */
+void tmp_objdir_discard_objects(struct tmp_objdir *);
+
+/*
  * Add the temporary object directory as an alternate object store in the
  * current process.
  */