Skip to content

Commit 6b4f57e

Browse files
chriscoolgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e265069 commit 6b4f57e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

diff.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "packfile.h"
2626
#include "parse-options.h"
2727
#include "help.h"
28-
#include "fetch-object.h"
28+
#include "promisor-remote.h"
2929

3030
#ifdef NO_FAST_WORKING_DIRECTORY
3131
#define FAST_WORKING_DIRECTORY 0
@@ -6379,8 +6379,7 @@ static void add_if_missing(struct repository *r,
63796379

63806380
void diffcore_std(struct diff_options *options)
63816381
{
6382-
if (options->repo == the_repository &&
6383-
repository_format_partial_clone) {
6382+
if (options->repo == the_repository && has_promisor_remote()) {
63846383
/*
63856384
* Prefetch the diff pairs that are about to be flushed.
63866385
*/
@@ -6397,8 +6396,7 @@ void diffcore_std(struct diff_options *options)
63976396
/*
63986397
* NEEDSWORK: Consider deduplicating the OIDs sent.
63996398
*/
6400-
fetch_objects(repository_format_partial_clone,
6401-
to_fetch.oid, to_fetch.nr);
6399+
promisor_remote_get_direct(to_fetch.oid, to_fetch.nr);
64026400
oid_array_clear(&to_fetch);
64036401
}
64046402

0 commit comments

Comments
 (0)