]> git.ipfire.org Git - thirdparty/git.git/blobdiff - read-cache.c
treewide: be explicit about dependence on trace.h & trace2.h
[thirdparty/git.git] / read-cache.c
index 3cc8e312dce2d3f4143da0d92df2b41722f1cfdc..a744eb89e4e638df8a3e44891576672a1ccd7c4f 100644 (file)
@@ -8,6 +8,7 @@
 #include "config.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "hex.h"
 #include "tempfile.h"
 #include "lockfile.h"
 #include "cache-tree.h"
 #include "tree.h"
 #include "commit.h"
 #include "blob.h"
+#include "environment.h"
+#include "gettext.h"
 #include "resolve-undo.h"
 #include "run-command.h"
 #include "strbuf.h"
+#include "trace2.h"
 #include "varint.h"
 #include "split-index.h"
 #include "utf8.h"
@@ -30,6 +34,7 @@
 #include "csum-file.h"
 #include "promisor-remote.h"
 #include "hook.h"
+#include "wrapper.h"
 
 /* Mask for the name length in ce_flags in the on-disk index */
 
@@ -264,7 +269,7 @@ static int ce_compare_link(const struct cache_entry *ce, size_t expected_size)
        if (strbuf_readlink(&sb, ce->name, expected_size))
                return -1;
 
-       buffer = read_object_file(&ce->oid, &type, &size);
+       buffer = repo_read_object_file(the_repository, &ce->oid, &type, &size);
        if (buffer) {
                if (size == sb.len)
                        match = memcmp(buffer, sb.buf, size);
@@ -2629,7 +2634,7 @@ int repo_index_has_changes(struct repository *repo,
 
        if (tree)
                cmp = tree->object.oid;
-       if (tree || !get_oid_tree("HEAD", &cmp)) {
+       if (tree || !repo_get_oid_tree(repo, "HEAD", &cmp)) {
                struct diff_options opt;
 
                repo_diff_setup(repo, &opt);
@@ -2948,7 +2953,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
        }
 
        if (!istate->version)
-               istate->version = get_index_format_default(the_repository);
+               istate->version = get_index_format_default(r);
 
        /* demote version 3 to version 2 when the latter suffices */
        if (istate->version == 3 || istate->version == 2)
@@ -3554,7 +3559,8 @@ void *read_blob_data_from_index(struct index_state *istate,
        }
        if (pos < 0)
                return NULL;
-       data = read_object_file(&istate->cache[pos]->oid, &type, &sz);
+       data = repo_read_object_file(the_repository, &istate->cache[pos]->oid,
+                                    &type, &sz);
        if (!data || type != OBJ_BLOB) {
                free(data);
                return NULL;