summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorHan Xin <hanxin.hx@bytedance.com>2022-07-01 09:34:30 +0800
committerJunio C Hamano <gitster@pobox.com>2022-06-30 23:00:32 -0700
commit3a1ea94a491e3e0bcbc2d55b4cfb0b9eacace608 (patch)
tree00b748d6bb087da26ebc381535f9ac87691d1bf4 /commit.h
parentdc8c8deaa6b5847733bd7df011a4c7b7d1a64e0a (diff)
commit-graph.c: no lazy fetch in lookup_commit_in_graph()
The commit-graph is used to opportunistically optimize accesses to certain pieces of information on commit objects, and lookup_commit_in_graph() tries to say "no" when the requested commit does not locally exist by returning NULL, in which case the caller can ask for (which may result in on-demand fetching from a promisor remote) and parse the commit object itself. However, it uses a wrong helper, repo_has_object_file(), to do so. This helper not only checks if an object is mmediately available in the local object store, but also tries to fetch from a promisor remote. But the fetch machinery calls lookup_commit_in_graph(), thus causing an infinite loop. We should make lookup_commit_in_graph() expect that a commit given to it can be legitimately missing from the local object store, by using the has_object_file() helper instead. Signed-off-by: Han Xin <hanxin.hx@bytedance.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
0 files changed, 0 insertions, 0 deletions