]> git.ipfire.org Git - thirdparty/git.git/blobdiff - connected.c
object-store-ll.h: split this header out of object-store.h
[thirdparty/git.git] / connected.c
index ed3025e7a2a7cffdc6607aa9408d097f6d537768..8f89376dbcf30cd2cf69c3d2eaa446e47c9f4ae8 100644 (file)
@@ -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");
@@ -110,7 +116,7 @@ no_promisor_pack_found:
 
        rev_list.git_cmd = 1;
        if (opt->env)
-               strvec_pushv(&rev_list.env_array, opt->env);
+               strvec_pushv(&rev_list.env, opt->env);
        rev_list.in = -1;
        rev_list.no_stdout = 1;
        if (opt->err_fd)
@@ -118,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);
 
@@ -151,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;
 }