diff options
author | Christian Couder <christian.couder@gmail.com> | 2019-06-25 15:40:31 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-25 14:05:37 -0700 |
commit | b14ed5adaf87c5943433fd6b1d2cbe8c060f9264 (patch) | |
tree | e7d525f2956fa56ef545ae2d8495fbe36363428e /packfile.c | |
parent | faf2abf496bb8e5a5fbf3818f3e78077b2f3e143 (diff) | |
download | git-b14ed5adaf87c5943433fd6b1d2cbe8c060f9264.tar.gz |
Use promisor_remote_get_direct() and has_promisor_remote()
Instead of using the repository_format_partial_clone global
and fetch_objects() directly, let's use has_promisor_remote()
and promisor_remote_get_direct().
This way all the configured promisor remotes will be taken
into account, not only the one specified by
extensions.partialClone.
Also when cloning or fetching using a partial clone filter,
remote.origin.promisor will be set to "true" instead of
setting extensions.partialClone to "origin". This makes it
possible to use many promisor remote just by fetching from
them.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r-- | packfile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packfile.c b/packfile.c index d786ec7312..50aaf93bc3 100644 --- a/packfile.c +++ b/packfile.c @@ -16,6 +16,7 @@ #include "tree.h" #include "object-store.h" #include "midx.h" +#include "promisor-remote.h" char *odb_pack_name(struct strbuf *buf, const unsigned char *sha1, @@ -2119,7 +2120,7 @@ int is_promisor_object(const struct object_id *oid) static int promisor_objects_prepared; if (!promisor_objects_prepared) { - if (repository_format_partial_clone) { + if (has_promisor_remote()) { for_each_packed_object(add_promisor_object, &promisor_objects, FOR_EACH_OBJECT_PROMISOR_ONLY); |