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

[PATCH 07/19] migrate merge-cache.c over to the new cache api's

From
BRBrad Roberts <braddr@gameboy2.puremagic.com>
Date
Apr 21, 2005, 18:36 UTC
Message-ID
<200504211836.j3LIaEUV027527@gameboy2.puremagic.com>

tree 8140acee0f9c57bfd87f40d1f99242c772afcdf2 parent 32efd81a3292a923ce5b5ae2e39ffefd0b08664d author Brad Roberts <braddr@puremagic.com> 1114074631 -0700 committer Brad Roberts <braddr@gameboy2.puremagic.com> 1114074631 -0700

[PATCH] migrate merge-cache.c over to the new cache api's
Signed-off-by: Brad Roberts <braddr@puremagic.com>
---
 merge-cache.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
Index: merge-cache.c
===================================================================
--- 32efd81a3292a923ce5b5ae2e39ffefd0b08664d:1/merge-cache.c  (mode:100644 sha1:35a0d588178aa5371399458b1a15519cffd645b8)
+++ e2acfff5e544a8c6769a9e665927092b3edd7579:1/merge-cache.c  (mode:100644 sha1:c2f96e7652a2aea9417c3790bfe9ab14ffcdb12f)
@@ -30,7 +30,7 @@
 {
 	int found;
 	
-	if (pos >= active_nr)
+	if (pos >= get_num_cache_entries())
 		die("merge-cache: %s not in the cache", path);
 	arguments[0] = pgm;
 	arguments[1] = "";
@@ -40,7 +40,7 @@
 	found = 0;
 	do {
 		static char hexbuf[4][60];
-		struct cache_entry *ce = active_cache[pos];
+		struct cache_entry *ce = get_cache_entry(pos);
 		int stage = ce_stage(ce);
 
 		if (strcmp(ce->name, path))
@@ -48,7 +48,7 @@
 		found++;
 		strcpy(hexbuf[stage], sha1_to_hex(ce->sha1));
 		arguments[stage] = hexbuf[stage];
-	} while (++pos < active_nr);
+	} while (++pos < get_num_cache_entries());
 	if (!found)
 		die("merge-cache: %s not in the cache", path);
 	run_program();
@@ -70,8 +70,8 @@
 static void merge_all(void)
 {
 	int i;
-	for (i = 0; i < active_nr; i++) {
-		struct cache_entry *ce = active_cache[i];
+	for (i = 0; i < get_num_cache_entries(); i++) {
+		struct cache_entry *ce = get_cache_entry(i);
 		if (!ce_stage(ce))
 			continue;
 		i += merge_entry(i, ce->name)-1;
Message 1 of 1 in “migrate merge-cache.c over to the new cache api's”
  1. 07/19 migrate merge-cache.c over to the new cache api'sBrad Roberts, Apr 21, 2005

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.