Merge branch 'jt/cache-tree-avoid-lazy-fetch-during-merge'
The cache-tree code has been taught to be less aggressive in attempting to see if a tree object it computed already exists in the repository. * jt/cache-tree-avoid-lazy-fetch-during-merge: cache-tree: do not lazy-fetch tentative tree
This commit is contained in:
commit
ae203ba414
@ -408,7 +408,7 @@ static int update_one(struct cache_tree *it,
|
|||||||
if (repair) {
|
if (repair) {
|
||||||
struct object_id oid;
|
struct object_id oid;
|
||||||
hash_object_file(buffer.buf, buffer.len, tree_type, &oid);
|
hash_object_file(buffer.buf, buffer.len, tree_type, &oid);
|
||||||
if (has_object_file(&oid))
|
if (has_object_file_with_flags(&oid, OBJECT_INFO_SKIP_FETCH_OBJECT))
|
||||||
oidcpy(&it->oid, &oid);
|
oidcpy(&it->oid, &oid);
|
||||||
else
|
else
|
||||||
to_invalidate = 1;
|
to_invalidate = 1;
|
||||||
|
@ -540,6 +540,20 @@ test_expect_success 'gc stops traversal when a missing but promised object is re
|
|||||||
! grep "$TREE_HASH" out
|
! grep "$TREE_HASH" out
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'do not fetch when checking existence of tree we construct ourselves' '
|
||||||
|
rm -rf repo &&
|
||||||
|
test_create_repo repo &&
|
||||||
|
test_commit -C repo base &&
|
||||||
|
test_commit -C repo side1 &&
|
||||||
|
git -C repo checkout base &&
|
||||||
|
test_commit -C repo side2 &&
|
||||||
|
|
||||||
|
git -C repo config core.repositoryformatversion 1 &&
|
||||||
|
git -C repo config extensions.partialclone "arbitrary string" &&
|
||||||
|
|
||||||
|
git -C repo cherry-pick side1
|
||||||
|
'
|
||||||
|
|
||||||
. "$TEST_DIRECTORY"/lib-httpd.sh
|
. "$TEST_DIRECTORY"/lib-httpd.sh
|
||||||
start_httpd
|
start_httpd
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user