summaryrefslogtreecommitdiff
path: root/sha1-file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-09-18 18:50:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-09-18 18:50:09 (GMT)
commitb9ac6c59b82dead613b31a51c8bca4dbd441bcbe (patch)
treedc91493ac2c087053c15b7b431da943e7abe701a /sha1-file.c
parentde67293e74888be95fb499560c1b38fe05b13af7 (diff)
parent4ca9474efa4fd431c07a470513e684c5b2eec34c (diff)
downloadgit-b9ac6c59b82dead613b31a51c8bca4dbd441bcbe.zip
git-b9ac6c59b82dead613b31a51c8bca4dbd441bcbe.tar.gz
git-b9ac6c59b82dead613b31a51c8bca4dbd441bcbe.tar.bz2
Merge branch 'cc/multi-promisor'
Teach the lazy clone machinery that there can be more than one promisor remote and consult them in order when downloading missing objects on demand. * cc/multi-promisor: Move core_partial_clone_filter_default to promisor-remote.c Move repository_format_partial_clone to promisor-remote.c Remove fetch-object.{c,h} in favor of promisor-remote.{c,h} remote: add promisor and partial clone config to the doc partial-clone: add multiple remotes in the doc t0410: test fetching from many promisor remotes builtin/fetch: remove unique promisor remote limitation promisor-remote: parse remote.*.partialclonefilter Use promisor_remote_get_direct() and has_promisor_remote() promisor-remote: use repository_format_partial_clone promisor-remote: add promisor_remote_reinit() promisor-remote: implement promisor_remote_get_direct() Add initial support for many promisor remotes fetch-object: make functions return an error code t0410: remove pipes after git commands
Diffstat (limited to 'sha1-file.c')
-rw-r--r--sha1-file.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sha1-file.c b/sha1-file.c
index 4895408..e85f249 100644
--- a/sha1-file.c
+++ b/sha1-file.c
@@ -30,8 +30,8 @@
#include "mergesort.h"
#include "quote.h"
#include "packfile.h"
-#include "fetch-object.h"
#include "object-store.h"
+#include "promisor-remote.h"
/* The maximum size for an object header. */
#define MAX_HEADER_LEN 32
@@ -1471,16 +1471,17 @@ int oid_object_info_extended(struct repository *r, const struct object_id *oid,
}
/* Check if it is a missing object */
- if (fetch_if_missing && repository_format_partial_clone &&
+ if (fetch_if_missing && has_promisor_remote() &&
!already_retried && r == the_repository &&
!(flags & OBJECT_INFO_SKIP_FETCH_OBJECT)) {
/*
- * TODO Investigate having fetch_object() return
- * TODO error/success and stopping the music here.
- * TODO Pass a repository struct through fetch_object,
- * such that arbitrary repositories work.
+ * TODO Investigate checking promisor_remote_get_direct()
+ * TODO return value and stopping on error here.
+ * TODO Pass a repository struct through
+ * promisor_remote_get_direct(), such that arbitrary
+ * repositories work.
*/
- fetch_objects(repository_format_partial_clone, real, 1);
+ promisor_remote_get_direct(r, real, 1);
already_retried = 1;
continue;
}