aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-10-15 10:29:29 -0700
committerJunio C Hamano <gitster@pobox.com>2025-10-15 10:29:29 -0700
commitbb5cdab7c0b9f126915f0904a8724eafb0456e08 (patch)
treecf518d8bcb6b2c3d499f01d9bd78ce7e2ab6f8ab
parentMerge branch 'ly/diff-name-only-with-diff-from-content' into maint-2.51 (diff)
parentfetch-pack: re-scan when double-checking graph objects (diff)
downloadgit-bb5cdab7c0b9f126915f0904a8724eafb0456e08.tar.gz
git-bb5cdab7c0b9f126915f0904a8724eafb0456e08.zip
Merge branch 'jk/fetch-check-graph-objects-fix' into maint-2.51
Under a race against another process that is repacking the repository, especially a partially cloned one, "git fetch" may mistakenly think some objects we do have are missing, which has been corrected. * jk/fetch-check-graph-objects-fix: fetch-pack: re-scan when double-checking graph objects
-rw-r--r--fetch-pack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 46c39f85c4..a9f5e6b510 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -143,7 +143,8 @@ static struct commit *deref_without_lazy_fetch(const struct object_id *oid,
commit = lookup_commit_in_graph(the_repository, oid);
if (commit) {
if (mark_tags_complete_and_check_obj_db) {
- if (!odb_has_object(the_repository->objects, oid, 0))
+ if (!odb_has_object(the_repository->objects, oid,
+ HAS_OBJECT_RECHECK_PACKED))
die_in_commit_graph_only(oid);
}
return commit;