Web lists-archives.com

[PATCH v5 08/16] diff: use promisor-remote.h instead of fetch-object.h




The repository_format_partial_clone global and fetch_objects()
should not be used anymore when there can be more than one
promisor remote. Instead let's use has_promisor_remote()
and promisor_remote_get_direct() from "promisor-remote.h".

This way all the configured promisor remotes will be taken
into account, not only the one specified by
extensions.partialClone.

Signed-off-by: Christian Couder <chriscool@xxxxxxxxxxxxx>
---
 diff.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/diff.c b/diff.c
index 4d3cf83a27..02864171fd 100644
--- a/diff.c
+++ b/diff.c
@@ -25,7 +25,7 @@
 #include "packfile.h"
 #include "parse-options.h"
 #include "help.h"
-#include "fetch-object.h"
+#include "promisor-remote.h"
 
 #ifdef NO_FAST_WORKING_DIRECTORY
 #define FAST_WORKING_DIRECTORY 0
@@ -6490,8 +6490,7 @@ static void add_if_missing(struct repository *r,
 
 void diffcore_std(struct diff_options *options)
 {
-	if (options->repo == the_repository &&
-	    repository_format_partial_clone) {
+	if (options->repo == the_repository && has_promisor_remote()) {
 		/*
 		 * Prefetch the diff pairs that are about to be flushed.
 		 */
@@ -6508,8 +6507,7 @@ void diffcore_std(struct diff_options *options)
 			/*
 			 * NEEDSWORK: Consider deduplicating the OIDs sent.
 			 */
-			fetch_objects(repository_format_partial_clone,
-				      to_fetch.oid, to_fetch.nr);
+			promisor_remote_get_direct(to_fetch.oid, to_fetch.nr);
 		oid_array_clear(&to_fetch);
 	}
 
-- 
2.21.0.750.g68c8ebb2ac