summaryrefslogtreecommitdiff
path: root/cache-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'cache-tree.c')
-rw-r--r--cache-tree.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/cache-tree.c b/cache-tree.c
index 88c2c04f87..ebfe649b33 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -1,13 +1,19 @@
#include "cache.h"
+#include "alloc.h"
+#include "environment.h"
+#include "hex.h"
#include "lockfile.h"
#include "tree.h"
#include "tree-walk.h"
#include "cache-tree.h"
#include "bulk-checkin.h"
+#include "object-file.h"
#include "object-store.h"
#include "replace-object.h"
#include "promisor-remote.h"
#include "sparse-index.h"
+#include "trace.h"
+#include "trace2.h"
#ifndef DEBUG_CACHE_TREE
#define DEBUG_CACHE_TREE 0
@@ -229,7 +235,7 @@ int cache_tree_fully_valid(struct cache_tree *it)
int i;
if (!it)
return 0;
- if (it->entry_count < 0 || !has_object_file(&it->oid))
+ if (it->entry_count < 0 || !repo_has_object_file(the_repository, &it->oid))
return 0;
for (i = 0; i < it->subtree_nr; i++) {
if (!cache_tree_fully_valid(it->down[i]->cache_tree))
@@ -240,7 +246,7 @@ int cache_tree_fully_valid(struct cache_tree *it)
static int must_check_existence(const struct cache_entry *ce)
{
- return !(has_promisor_remote() && ce_skip_worktree(ce));
+ return !(repo_has_promisor_remote(the_repository) && ce_skip_worktree(ce));
}
static int update_one(struct cache_tree *it,
@@ -280,7 +286,7 @@ static int update_one(struct cache_tree *it,
}
}
- if (0 <= it->entry_count && has_object_file(&it->oid))
+ if (0 <= it->entry_count && repo_has_object_file(the_repository, &it->oid))
return it->entry_count;
/*
@@ -386,7 +392,7 @@ static int update_one(struct cache_tree *it,
ce_missing_ok = mode == S_IFGITLINK || missing_ok ||
!must_check_existence(ce);
if (is_null_oid(oid) ||
- (!ce_missing_ok && !has_object_file(oid))) {
+ (!ce_missing_ok && !repo_has_object_file(the_repository, oid))) {
strbuf_release(&buffer);
if (expected_missing)
return -1;
@@ -434,7 +440,7 @@ static int update_one(struct cache_tree *it,
struct object_id oid;
hash_object_file(the_hash_algo, buffer.buf, buffer.len,
OBJ_TREE, &oid);
- if (has_object_file_with_flags(&oid, OBJECT_INFO_SKIP_FETCH_OBJECT))
+ if (repo_has_object_file_with_flags(the_repository, &oid, OBJECT_INFO_SKIP_FETCH_OBJECT))
oidcpy(&it->oid, &oid);
else
to_invalidate = 1;
@@ -470,7 +476,7 @@ int cache_tree_update(struct index_state *istate, int flags)
if (!istate->cache_tree)
istate->cache_tree = cache_tree();
- if (!(flags & WRITE_TREE_MISSING_OK) && has_promisor_remote())
+ if (!(flags & WRITE_TREE_MISSING_OK) && repo_has_promisor_remote(the_repository))
prefetch_cache_entries(istate, must_check_existence);
trace_performance_enter();
@@ -814,14 +820,14 @@ void prime_cache_tree(struct repository *r,
{
struct strbuf tree_path = STRBUF_INIT;
- trace2_region_enter("cache-tree", "prime_cache_tree", the_repository);
+ trace2_region_enter("cache-tree", "prime_cache_tree", r);
cache_tree_free(&istate->cache_tree);
istate->cache_tree = cache_tree();
prime_cache_tree_rec(r, istate->cache_tree, tree, &tree_path);
strbuf_release(&tree_path);
istate->cache_changed |= CACHE_TREE_CHANGED;
- trace2_region_leave("cache-tree", "prime_cache_tree", the_repository);
+ trace2_region_leave("cache-tree", "prime_cache_tree", r);
}
/*