Skip to content

Commit 2cb55c2

Browse files
jeffhostetlerdscho
authored andcommitted
trace2:gvfs:experiment: add region to cache_tree_fully_valid()
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
1 parent 8d5bb91 commit 2cb55c2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

cache-tree.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,15 @@ static void discard_unused_subtrees(struct cache_tree *it)
231231
}
232232
}
233233

234-
int cache_tree_fully_valid(struct cache_tree *it)
234+
static int cache_tree_fully_valid_1(struct cache_tree *it)
235235
{
236236
int i;
237237
if (!it)
238238
return 0;
239239
if (it->entry_count < 0 || !repo_has_object_file(the_repository, &it->oid))
240240
return 0;
241241
for (i = 0; i < it->subtree_nr; i++) {
242-
if (!cache_tree_fully_valid(it->down[i]->cache_tree))
242+
if (!cache_tree_fully_valid_1(it->down[i]->cache_tree))
243243
return 0;
244244
}
245245
return 1;
@@ -250,6 +250,17 @@ static int must_check_existence(const struct cache_entry *ce)
250250
return !(repo_has_promisor_remote(the_repository) && ce_skip_worktree(ce));
251251
}
252252

253+
int cache_tree_fully_valid(struct cache_tree *it)
254+
{
255+
int result;
256+
257+
trace2_region_enter("cache_tree", "fully_valid", NULL);
258+
result = cache_tree_fully_valid_1(it);
259+
trace2_region_leave("cache_tree", "fully_valid", NULL);
260+
261+
return result;
262+
}
263+
253264
static int update_one(struct cache_tree *it,
254265
struct cache_entry **cache,
255266
int entries,

0 commit comments

Comments
 (0)