From: Junio C Hamano Date: Fri, 10 Feb 2006 01:17:02 GMT Subject: [PATCH] count-delta.c: Match the delta data semantics change in version 3. Message-ID: <7vbqxg3tdd.fsf_-_@assigned-by-dhcp.cox.net> In-Reply-To: <7v7j846qco.fsf@assigned-by-dhcp.cox.net> Junio C Hamano writes: > 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 --- 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