Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2019-06-25 16:40:31 +0300
committerJunio C Hamano <gitster@pobox.com>2019-06-26 00:05:37 +0300
commitb14ed5adaf87c5943433fd6b1d2cbe8c060f9264 (patch)
treee7d525f2956fa56ef545ae2d8495fbe36363428e /unpack-trees.c
parentfaf2abf496bb8e5a5fbf3818f3e78077b2f3e143 (diff)
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 'unpack-trees.c')
-rw-r--r--unpack-trees.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 50189909b8..aebd865ef6 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -16,7 +16,7 @@
#include "submodule-config.h"
#include "fsmonitor.h"
#include "object-store.h"
-#include "fetch-object.h"
+#include "promisor-remote.h"
/*
* Error messages expected by scripts out of plumbing commands such as
@@ -400,7 +400,7 @@ static int check_updates(struct unpack_trees_options *o)
load_gitmodules_file(index, &state);
enable_delayed_checkout(&state);
- if (repository_format_partial_clone && o->update && !o->dry_run) {
+ if (has_promisor_remote() && o->update && !o->dry_run) {
/*
* Prefetch the objects that are to be checked out in the loop
* below.
@@ -419,8 +419,8 @@ static int check_updates(struct unpack_trees_options *o)
oid_array_append(&to_fetch, &ce->oid);
}
if (to_fetch.nr)
- fetch_objects(repository_format_partial_clone,
- to_fetch.oid, to_fetch.nr);
+ promisor_remote_get_direct(the_repository,
+ to_fetch.oid, to_fetch.nr);
oid_array_clear(&to_fetch);
}
for (i = 0; i < index->cache_nr; i++) {