summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorJens Lindström <jl@opera.com>2014-05-23 12:29:45 +0200
committerJunio C Hamano <gitster@pobox.com>2014-05-27 12:30:42 -0700
commitc9e768bb77762765f739fffb5c09d0888f3de20e (patch)
treeec3e7555084a3d62830bbef801590ce64cada955 /refs.h
parentb07bdd3472886cbdd412ee3e7489273522c43133 (diff)
downloadgit-c9e768bb77762765f739fffb5c09d0888f3de20e.tar.gz
remote: repack packed-refs once when deleting multiple refs
When 'git remote rm' or 'git remote prune' were used in a repository with many refs, and needed to delete many remote-tracking refs, a lot of time was spent deleting those refs since for each deleted ref, repack_without_refs() was called to rewrite packed-refs without just that deleted ref. To avoid this, call repack_without_refs() first to repack without all the refs that will be deleted, before calling delete_ref() to delete each one completely. The call to repack_without_ref() in delete_ref() then becomes a no-op, since packed-refs already won't contain any of the deleted refs. Signed-off-by: Jens Lindström <jl@opera.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 87a1a79ad6..f287c7aa65 100644
--- a/refs.h
+++ b/refs.h
@@ -132,6 +132,8 @@ extern void rollback_packed_refs(void);
*/
int pack_refs(unsigned int flags);
+extern int repack_without_refs(const char **refnames, int n);
+
extern int ref_exists(const char *);
/*