diff options
Diffstat (limited to 'connected.c')
-rw-r--r-- | connected.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/connected.c b/connected.c index 35bd4a2..8f89376 100644 --- a/connected.c +++ b/connected.c @@ -1,5 +1,7 @@ -#include "cache.h" -#include "object-store.h" +#include "git-compat-util.h" +#include "gettext.h" +#include "hex.h" +#include "object-store-ll.h" #include "run-command.h" #include "sigchain.h" #include "connected.h" @@ -54,7 +56,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data, strbuf_release(&idx_file); } - if (has_promisor_remote()) { + if (repo_has_promisor_remote(the_repository)) { /* * For partial clones, we don't want to have to do a regular * connectivity check because we have to enumerate and exclude @@ -85,6 +87,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data, promisor_pack_found: ; } while ((oid = fn(cb_data)) != NULL); + free(new_pack); return 0; } @@ -96,10 +99,13 @@ no_promisor_pack_found: strvec_push(&rev_list.args,"rev-list"); strvec_push(&rev_list.args, "--objects"); strvec_push(&rev_list.args, "--stdin"); - if (has_promisor_remote()) + if (repo_has_promisor_remote(the_repository)) strvec_push(&rev_list.args, "--exclude-promisor-objects"); if (!opt->is_deepening_fetch) { strvec_push(&rev_list.args, "--not"); + if (opt->exclude_hidden_refs_section) + strvec_pushf(&rev_list.args, "--exclude-hidden=%s", + opt->exclude_hidden_refs_section); strvec_push(&rev_list.args, "--all"); } strvec_push(&rev_list.args, "--quiet"); @@ -109,7 +115,8 @@ no_promisor_pack_found: _("Checking connectivity")); rev_list.git_cmd = 1; - rev_list.env = opt->env; + if (opt->env) + strvec_pushv(&rev_list.env, opt->env); rev_list.in = -1; rev_list.no_stdout = 1; if (opt->err_fd) @@ -117,8 +124,10 @@ no_promisor_pack_found: else rev_list.no_stderr = opt->quiet; - if (start_command(&rev_list)) + if (start_command(&rev_list)) { + free(new_pack); return error(_("Could not run 'git rev-list'")); + } sigchain_push(SIGPIPE, SIG_IGN); @@ -150,5 +159,6 @@ no_promisor_pack_found: err = error_errno(_("failed to close rev-list's stdin")); sigchain_pop(SIGPIPE); + free(new_pack); return finish_command(&rev_list) || err; } |