From cfd971520ed11096aaa11f6bd1ee99b307f3146c Mon Sep 17 00:00:00 2001 From: John Cai Date: Fri, 9 Aug 2024 15:37:49 +0000 Subject: 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 Signed-off-by: Junio C Hamano --- refs/ref-cache.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'refs/ref-cache.h') diff --git a/refs/ref-cache.h b/refs/ref-cache.h index 31ebe24f6c..5f04e518c3 100644 --- a/refs/ref-cache.h +++ b/refs/ref-cache.h @@ -42,6 +42,7 @@ struct ref_value { * referred to by the last reference in the symlink chain. */ struct object_id oid; + char *referent; }; /* @@ -173,6 +174,7 @@ struct ref_entry *create_dir_entry(struct ref_cache *cache, const char *dirname, size_t len); struct ref_entry *create_ref_entry(const char *refname, + const char *referent, const struct object_id *oid, int flag); /* -- cgit v1.3