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

[PATCH] count-delta.c: Match the delta data semantics change in version 3.

From
Junio C Hamano <junkio@cox.net>
Date
Feb 10, 2006, 01:17 UTC
Message-ID
<7vbqxg3tdd.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7v7j846qco.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 6 quoted lines
> I agree with the general direction and this futureproofing is a
> good thing to have before 1.2.0, I think.
>
> The bit is however _already_ looked at by the count_delta(),
> to assess the extent of damage, IIRC.  Should we be
> futureproofing that bit as well?
Something like this?

-- >8 -- This matches the count_delta() logic to the change previous commit introduces to patch_delta().

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 count-delta.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
6cb2807fd27b9e970a9b012b925deab99f480d61
diff --git a/count-delta.c b/count-delta.c
index 7559ff6..978a60c 100644
--- a/count-delta.c
+++ b/count-delta.c
@@ -50,13 +50,10 @@ int count_delta(void *delta_buf, unsigne
 			if (cmd & 0x08) cp_off |= (*data++ << 24);
 			if (cmd & 0x10) cp_size = *data++;
 			if (cmd & 0x20) cp_size |= (*data++ << 8);
+			if (cmd & 0x40) cp_size |= (*data++ << 16);
 			if (cp_size == 0) cp_size = 0x10000;
 
-			if (cmd & 0x40)
-				/* copy from dst */
-				;
-			else
-				copied_from_source += cp_size;
+			copied_from_source += cp_size;
 			out += cp_size;
 		} else {
 			/* write literal into dst */
-- 
1.1.6.gce16
Previous: Junio C HamanoNext: Nicolas Pitre
Message 3 of 6 in “remove delta-against-self bit”
  1. remove delta-against-self bitNicolas Pitre, Feb 9, 2006
  2. Junio C HamanoFeb 9, 2006
  3. count-delta.c: Match the delta data semantics change in version 3.Junio C Hamano, Feb 10, 2006
  4. Nicolas PitreFeb 10, 2006
  5. Nicolas PitreFeb 10, 2006
  6. Junio C HamanoFeb 10, 2006

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.