summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-02-14 12:54:21 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-02-14 12:54:21 -0800
commit8fb39450371ce9a89e0f551c94f02e73819f8325 (patch)
tree49d4c67e4904dd54809a9b3aa9f76875c8ed3d39 /builtin
parentMerge branch 'jk/get-oid-error-message-i18n' (diff)
parentfetch: forgo full connectivity check if --filter (diff)
downloadtgif-8fb39450371ce9a89e0f551c94f02e73819f8325.tar.xz
Merge branch 'jt/connectivity-check-optim-in-partial-clone'
Unneeded connectivity check is now disabled in a partial clone when fetching into it. * jt/connectivity-check-optim-in-partial-clone: fetch: forgo full connectivity check if --filter connected: verify promisor-ness of partial clone
Diffstat (limited to 'builtin')
-rw-r--r--builtin/clone.c5
-rw-r--r--builtin/fetch.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 0fc89ae2b9..0516181052 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -673,7 +673,7 @@ static void update_remote_refs(const struct ref *refs,
const char *msg,
struct transport *transport,
int check_connectivity,
- int check_refs_only)
+ int check_refs_are_promisor_objects_only)
{
const struct ref *rm = mapped_refs;
@@ -682,7 +682,8 @@ static void update_remote_refs(const struct ref *refs,
opt.transport = transport;
opt.progress = transport->progress;
- opt.check_refs_only = !!check_refs_only;
+ opt.check_refs_are_promisor_objects_only =
+ !!check_refs_are_promisor_objects_only;
if (check_connected(iterate_ref_map, &rm, &opt))
die(_("remote did not send all necessary objects"));
diff --git a/builtin/fetch.c b/builtin/fetch.c
index b4c6d921d0..6fb50320eb 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -906,8 +906,17 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
url = xstrdup("foreign");
if (!connectivity_checked) {
+ struct check_connected_options opt = CHECK_CONNECTED_INIT;
+
+ if (filter_options.choice)
+ /*
+ * Since a filter is specified, objects indirectly
+ * referenced by refs are allowed to be absent.
+ */
+ opt.check_refs_are_promisor_objects_only = 1;
+
rm = ref_map;
- if (check_connected(iterate_ref_map, &rm, NULL)) {
+ if (check_connected(iterate_ref_map, &rm, &opt)) {
rc = error(_("%s did not send all necessary objects\n"), url);
goto abort;
}