[PATCH 10/13] update delta handling in write_object() for --pack-limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
builtin-pack-objects.c |    6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

--
Dana L. How  danahow@xxxxxxxxx  +1 650 804 5991 cell
From 7ee505accac1675269d1fcfc7a6e3bcf70792a2f Mon Sep 17 00:00:00 2001
From: Dana How <how@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 5 Apr 2007 14:11:21 -0700
Subject: [PATCH 10/13] update delta handling in write_object() for --pack-limit

---
 builtin-pack-objects.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index ccc2d15..a243eed 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -419,13 +419,17 @@ static off_t write_object(struct sha1file *f,
 	}
 
 	if (!to_reuse) {
+		int usable_delta =	!entry->delta ? 0 :
+					!offset_limit ? 1 :
+					entry->delta->no_write ? 0 :
+					entry->delta->offset ? 1 : 0;
 		buf = read_sha1_file(entry->sha1, &type, &size);
 		if (!buf)
 			die("unable to read %s", sha1_to_hex(entry->sha1));
 		if (size != entry->size)
 			die("object %s size inconsistency (%lu vs %lu)",
 			    sha1_to_hex(entry->sha1), size, entry->size);
-		if (entry->delta) {
+		if (usable_delta) {
 			buf = delta_against(buf, size, entry);
 			size = entry->delta_size;
 			obj_type = (allow_ofs_delta && entry->delta->offset) ?
-- 
1.5.1.rc2.18.g9c88-dirty


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]