summaryrefslogtreecommitdiff
path: root/builtin/gc.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2017-12-08 15:27:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-08 17:52:42 (GMT)
commit0c16cd499dee09b7fc6dd10cb6a476e96c147ef6 (patch)
tree782bff532cd6dc373c26979de66eb9abbf872b6a /builtin/gc.c
parentdf11e1964825b825e179ccdbc1b9e3a6fc09e67a (diff)
downloadgit-0c16cd499dee09b7fc6dd10cb6a476e96c147ef6.zip
git-0c16cd499dee09b7fc6dd10cb6a476e96c147ef6.tar.gz
git-0c16cd499dee09b7fc6dd10cb6a476e96c147ef6.tar.bz2
gc: do not repack promisor packfiles
Teach gc to stop traversal at promisor objects, and to leave promisor packfiles alone. This has the effect of only repacking non-promisor packfiles, and preserves the distinction between promisor packfiles and non-promisor packfiles. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/gc.c')
-rw-r--r--builtin/gc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index 3c5eae0..77fa720 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -458,6 +458,9 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
argv_array_push(&prune, prune_expire);
if (quiet)
argv_array_push(&prune, "--no-progress");
+ if (repository_format_partial_clone)
+ argv_array_push(&prune,
+ "--exclude-promisor-objects");
if (run_command_v_opt(prune.argv, RUN_GIT_CMD))
return error(FAILED_RUN, prune.argv[0]);
}