summaryrefslogtreecommitdiff
path: root/cache-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-10-19 04:34:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-19 04:34:08 (GMT)
commita08b1d62b0c58c795b3ddbe34ea1f68786b95c82 (patch)
tree41ea597bdcbef73f5475f7906551d8748a3b2910 /cache-tree.c
parent465e73fff380808f0ba3fb17984ab8636afb6405 (diff)
parent2f215ff10bdf02f6c760ea34968fc39ae75ae449 (diff)
downloadgit-a08b1d62b0c58c795b3ddbe34ea1f68786b95c82.zip
git-a08b1d62b0c58c795b3ddbe34ea1f68786b95c82.tar.gz
git-a08b1d62b0c58c795b3ddbe34ea1f68786b95c82.tar.bz2
Merge branch 'jt/cache-tree-allow-missing-object-in-partial-clone'
In a partial clone that will lazily be hydrated from the originating repository, we generally want to avoid "does this object exist (locally)?" on objects that we deliberately omitted when we created the clone. The cache-tree codepath (which is used to write a tree object out of the index) however insisted that the object exists, even for paths that are outside of the partial checkout area. The code has been updated to avoid such a check. * jt/cache-tree-allow-missing-object-in-partial-clone: cache-tree: skip some blob checks in partial clone
Diffstat (limited to 'cache-tree.c')
-rw-r--r--cache-tree.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cache-tree.c b/cache-tree.c
index 9c5cf2c..9d454d2 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -326,6 +326,7 @@ static int update_one(struct cache_tree *it,
unsigned mode;
int expected_missing = 0;
int contains_ita = 0;
+ int ce_missing_ok;
path = ce->name;
pathlen = ce_namelen(ce);
@@ -355,8 +356,11 @@ static int update_one(struct cache_tree *it,
i++;
}
+ ce_missing_ok = mode == S_IFGITLINK || missing_ok ||
+ (repository_format_partial_clone &&
+ ce_skip_worktree(ce));
if (is_null_oid(oid) ||
- (mode != S_IFGITLINK && !missing_ok && !has_object_file(oid))) {
+ (!ce_missing_ok && !has_object_file(oid))) {
strbuf_release(&buffer);
if (expected_missing)
return -1;