Thread (33 messages) flat view 33 messages, 6 authors, 2016-06-15
DORMANTno replies

[PATCH] Teach git-gc to merge unsorted softrefs

From: Johan Herland <hidden>
Date: 2016-06-15 22:43:15
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Johan Herland <redacted>
---

On Sunday 10 June 2007, Jakub Narebski wrote:
Perhaps git-gc should also sort softrefs (if it doesn't do it yet)?
Sure.

 builtin-gc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/builtin-gc.c b/builtin-gc.c
index 45025fb..30e1e44 100644
--- a/builtin-gc.c
+++ b/builtin-gc.c
@@ -12,6 +12,7 @@
 
 #include "cache.h"
 #include "run-command.h"
+#include "softrefs.h"
 
 #define FAILED_RUN "failed to run %s"
 
@@ -87,6 +88,9 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
 	if (i != argc)
 		usage(builtin_gc_usage);
 
+	if (merge_unsorted_softrefs(NULL, 1))
+		return error("failed to merge unsorted softrefs");
+
 	if (pack_refs && run_command_v_opt(argv_pack_refs, RUN_GIT_CMD))
 		return error(FAILED_RUN, argv_pack_refs[0]);
 
-- 
1.5.2.1.144.gabc40
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help