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

[PATCH] fix bug in read-cache.c which loses files when merging a tree

From
JBJames Bottomley <james.bottomley@steeleye.com>
Date
Apr 18, 2005, 18:17 UTC
Message-ID
<1113848239.4998.45.camel@mulgrave>

I noticed this when I tried a non-trivial scsi merge and checked the results against BK. The problem is that remove_entry_at() actually decrements active_nr, so decrementing it in add_cache_entry() before calling remove_entry_at() is a double decrement (hence we lose cache entries at the end).

James

read-cache.c: 4d4d94f75cceb8039eb466c1956f8b54dc0e24b6 --- read-cache.c +++ read-cache.c 2005-04-18 13:08:09.000000000 -0500

@@ -402,7 +402,6 @@
 	if (pos < active_nr && ce_stage(ce) == 0) {
 		while (same_name(active_cache[pos], ce)) {
 			ok_to_add = 1;
-			active_nr--;
 			if (!remove_entry_at(pos))
 				break;
 		}
Next: Linus Torvalds
Message 1 of 5 in “fix bug in read-cache.c which loses files when merging a tree”
  1. fix bug in read-cache.c which loses files when merging a treeJames Bottomley, Apr 18, 2005
  2. Linus TorvaldsApr 18, 2005
  3. Linus TorvaldsApr 18, 2005
  4. Petr BaudisApr 18, 2005
  5. Linus TorvaldsApr 18, 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.