]> git.ipfire.org Git - thirdparty/git.git/commit
refs: keep track of unresolved reference value in iterators
authorJohn Cai <johncai86@gmail.com>
Fri, 9 Aug 2024 15:37:49 +0000 (15:37 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Aug 2024 15:47:33 +0000 (08:47 -0700)
commitcfd971520ed11096aaa11f6bd1ee99b307f3146c
tree616578d53f64884cdac7bd6906572d109d7a36f1
parent39bf06adf96da25b87c9aa7d35a32ef3683eb4a4
refs: keep track of unresolved reference value in iterators

Since ref iterators do not hold onto the direct value of a reference
without resolving it, the only way to get ahold of a direct value of a
symbolic ref is to make a separate call to refs_read_symbolic_ref.

To make accessing the direct value of a symbolic ref more efficient,
let's save the direct value of the ref in the iterators for both the
files backend and the reftable backend.

Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
refs/iterator.c
refs/ref-cache.c
refs/ref-cache.h
refs/refs-internal.h
refs/reftable-backend.c