]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fetch-pack.c
fsmonitor: reduce includes of cache.h
[thirdparty/git.git] / fetch-pack.c
index 04016d1e3250f28ae6cd53a784913f02879769d8..677102465a12c3c2fa4ab7f5a40b4b28c3cc5afd 100644 (file)
@@ -1,6 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "alloc.h"
 #include "repository.h"
 #include "config.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
 #include "lockfile.h"
 #include "refs.h"
 #include "pkt-line.h"
@@ -13,6 +17,7 @@
 #include "remote.h"
 #include "run-command.h"
 #include "connect.h"
+#include "trace2.h"
 #include "transport.h"
 #include "version.h"
 #include "oid-array.h"
@@ -27,6 +32,7 @@
 #include "commit-graph.h"
 #include "sigchain.h"
 #include "mergesort.h"
+#include "wrapper.h"
 
 static int transfer_unpack_limit = -1;
 static int fetch_unpack_limit = -1;
@@ -722,7 +728,7 @@ static void filter_refs(struct fetch_pack_args *args,
        *refs = newlist;
 }
 
-static void mark_alternate_complete(struct fetch_negotiator *unused,
+static void mark_alternate_complete(struct fetch_negotiator *negotiator UNUSED,
                                    struct object *obj)
 {
        mark_complete(&obj->oid);
@@ -762,9 +768,9 @@ static void mark_complete_and_common_ref(struct fetch_negotiator *negotiator,
                if (!commit) {
                        struct object *o;
 
-                       if (!has_object_file_with_flags(&ref->old_oid,
-                                               OBJECT_INFO_QUICK |
-                                               OBJECT_INFO_SKIP_FETCH_OBJECT))
+                       if (!repo_has_object_file_with_flags(the_repository, &ref->old_oid,
+                                                            OBJECT_INFO_QUICK |
+                                                            OBJECT_INFO_SKIP_FETCH_OBJECT))
                                continue;
                        o = parse_object(the_repository, &ref->old_oid);
                        if (!o || o->type != OBJ_COMMIT)
@@ -1963,7 +1969,7 @@ static void update_shallow(struct fetch_pack_args *args,
                struct oid_array extra = OID_ARRAY_INIT;
                struct object_id *oid = si->shallow->oid;
                for (i = 0; i < si->shallow->nr; i++)
-                       if (has_object_file(&oid[i]))
+                       if (repo_has_object_file(the_repository, &oid[i]))
                                oid_array_append(&extra, &oid[i]);
                if (extra.nr) {
                        setup_alternate_shallow(&shallow_lock,