summaryrefslogtreecommitdiff
path: root/connected.c
diff options
context:
space:
mode:
Diffstat (limited to 'connected.c')
-rw-r--r--connected.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/connected.c b/connected.c
index cd9b324..c337f5f 100644
--- a/connected.c
+++ b/connected.c
@@ -5,6 +5,7 @@
#include "connected.h"
#include "transport.h"
#include "packfile.h"
+#include "promisor-remote.h"
/*
* If we feed all the commits we want to verify to this command
@@ -28,6 +29,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
struct packed_git *new_pack = NULL;
struct transport *transport;
size_t base_len;
+ const unsigned hexsz = the_hash_algo->hexsz;
if (!opt)
opt = &defaults;
@@ -60,7 +62,8 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
* received the objects pointed to by each wanted ref.
*/
do {
- if (!repo_has_object_file(the_repository, &oid))
+ if (!repo_has_object_file_with_flags(the_repository, &oid,
+ OBJECT_INFO_SKIP_FETCH_OBJECT))
return 1;
} while (!fn(cb_data, &oid));
return 0;
@@ -73,7 +76,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
argv_array_push(&rev_list.args,"rev-list");
argv_array_push(&rev_list.args, "--objects");
argv_array_push(&rev_list.args, "--stdin");
- if (repository_format_partial_clone)
+ if (has_promisor_remote())
argv_array_push(&rev_list.args, "--exclude-promisor-objects");
if (!opt->is_deepening_fetch) {
argv_array_push(&rev_list.args, "--not");
@@ -99,7 +102,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
sigchain_push(SIGPIPE, SIG_IGN);
- commit[GIT_SHA1_HEXSZ] = '\n';
+ commit[hexsz] = '\n';
do {
/*
* If index-pack already checked that:
@@ -112,8 +115,8 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
if (new_pack && find_pack_entry_one(oid.hash, new_pack))
continue;
- memcpy(commit, oid_to_hex(&oid), GIT_SHA1_HEXSZ);
- if (write_in_full(rev_list.in, commit, GIT_SHA1_HEXSZ + 1) < 0) {
+ memcpy(commit, oid_to_hex(&oid), hexsz);
+ if (write_in_full(rev_list.in, commit, hexsz + 1) < 0) {
if (errno != EPIPE && errno != EINVAL)
error_errno(_("failed write to rev-list"));
err = -1;