diff mbox series

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

Message ID 20190409161116.30256-9-chriscool@tuxfamily.org (mailing list archive)
State New, archived
Headers show
Series Many promisor remotes | expand

Commit Message

Christian Couder April 9, 2019, 4:11 p.m. UTC
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@tuxfamily.org>
---
 diff.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

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);
 	}