Merge branch 'dl/cache-tree-fully-valid-fix'
The check that implements the logic to see if an in-core cache-tree is fully ready to write out a tree object was broken, which has been corrected. * dl/cache-tree-fully-valid-fix: cache-tree: fix inverted object existence check in cache_tree_fully_validmain
commit
ab0691db4e
|
|
@ -238,8 +238,8 @@ int cache_tree_fully_valid(struct cache_tree *it)
|
|||
if (!it)
|
||||
return 0;
|
||||
if (it->entry_count < 0 ||
|
||||
odb_has_object(the_repository->objects, &it->oid,
|
||||
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
|
||||
!odb_has_object(the_repository->objects, &it->oid,
|
||||
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
|
||||
return 0;
|
||||
for (i = 0; i < it->subtree_nr; i++) {
|
||||
if (!cache_tree_fully_valid(it->down[i]->cache_tree))
|
||||
|
|
|
|||
|
|
@ -278,4 +278,12 @@ test_expect_success 'switching trees does not invalidate shared index' '
|
|||
)
|
||||
'
|
||||
|
||||
test_expect_success 'cache-tree is used by write-tree when valid' '
|
||||
test_commit use-valid &&
|
||||
|
||||
# write-tree with a valid cache-tree should skip cache_tree_update
|
||||
GIT_TRACE2_PERF="$(pwd)/trace.output" git write-tree &&
|
||||
test_grep ! region_enter.*cache_tree.*update trace.output
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
|
|||
Loading…
Reference in New Issue