git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] read-cache: hide refresh_cache_entry()

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 28, 2026, 20:34 UTC
Message-ID
<xmqq4ie58syl.fsf@gitster.g>

Once upon a time, there was a merge strategy called "recursive", which was added in 6d297f8137 (Status update on merge-recursive in C, 2006-07-08). This implementation came with its own machinery that creates an in-core index entry, and then refreshed the index entry it created by calling the refresh_cache_entry() function borrowed from the read-cache.c API. refresh_cache_entry() used to be file-scope static, but was made public with this change.

When ad45b327c0 (merge-recursive.[ch]: thoroughly debug these, 2025-04-08) finally removed the entire code for the "recursive" merge strategy, the last external caller of refresh_cache_entry() went with it.

Hide the low-level implementation detail again by making it a file-scope static function. The external callers would indirectly call it when they call make_cache_entry() or rename_index_entry_at() external interface, which "ort" (the successor of "recursive") does.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 read-cache-ll.h | 2 --
 read-cache.c    | 8 +++++---
 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/read-cache-ll.h b/read-cache-ll.h
index 066dd8bc3b..dd30befbb3 100644
--- a/read-cache-ll.h
+++ b/read-cache-ll.h
@@ -475,8 +475,6 @@ int refresh_index(struct index_state *, unsigned int flags, const struct pathspe
  */
 int repo_refresh_and_write_index(struct repository*, unsigned int refresh_flags, unsigned int write_flags, int gentle, const struct pathspec *, char *seen, const char *header_msg);
 
-struct cache_entry *refresh_cache_entry(struct index_state *, struct cache_entry *, unsigned int);
-
 void set_alternate_index_output(const char *);
 
 extern int verify_index_checksum;
diff --git a/read-cache.c b/read-cache.c
index c4cf08a3a3..94dff890a7 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -129,6 +129,8 @@ static struct mem_pool *find_mem_pool(struct index_state *istate)
 	return *pool_ptr;
 }
 
+static struct cache_entry *refresh_cache_entry(struct index_state *, struct cache_entry *, unsigned int);
+
 static const char *alternate_index_output;
 
 static void set_index_entry(struct index_state *istate, int nr, struct cache_entry *ce)
@@ -1624,9 +1626,9 @@ int refresh_index(struct index_state *istate, unsigned int flags,
 	return has_errors;
 }
 
-struct cache_entry *refresh_cache_entry(struct index_state *istate,
-					struct cache_entry *ce,
-					unsigned int options)
+static struct cache_entry *refresh_cache_entry(struct index_state *istate,
+					       struct cache_entry *ce,
+					       unsigned int options)
 {
 	return refresh_cache_ent(istate, ce, options, NULL, NULL, NULL, NULL);
 }
-- 
2.56.0-433-ga9209adf11
Next: Patrick Steinhardt
Message 1 of 5 in “read-cache: hide refresh_cache_entry()”
  1. read-cache: hide refresh_cache_entry()Junio C Hamano, Oct 28, 2026
  2. Patrick SteinhardtOct 30, 2026
  3. Junio C HamanoOct 30, 2026
  4. Patrick SteinhardtNov 2, 2026
  5. Junio C HamanoNov 2, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.