Skip to content

Commit

Permalink
Merge branch 'jc/pack'
Browse files Browse the repository at this point in the history
  • Loading branch information
Junio C Hamano committed May 2, 2006
2 parents 95a31cc + 9a8b6a0 commit cbd800b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,12 +1032,6 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
max_depth -= cur_entry->delta_limit;
}

size = cur_entry->size;
oldsize = old_entry->size;
sizediff = oldsize > size ? oldsize - size : size - oldsize;

if (size < 50)
return -1;
if (old_entry->depth >= max_depth)
return 0;

Expand All @@ -1048,9 +1042,12 @@ static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
* more space-efficient (deletes don't have to say _what_ they
* delete).
*/
size = cur_entry->size;
max_size = size / 2 - 20;
if (cur_entry->delta)
max_size = cur_entry->delta_size-1;
oldsize = old_entry->size;
sizediff = oldsize < size ? size - oldsize : 0;
if (sizediff >= max_size)
return 0;
delta_buf = diff_delta(old->data, oldsize,
Expand Down Expand Up @@ -1109,6 +1106,9 @@ static void find_deltas(struct object_entry **list, int window, int depth)
*/
continue;

if (entry->size < 50)
continue;

free(n->data);
n->entry = entry;
n->data = read_sha1_file(entry->sha1, type, &size);
Expand Down

0 comments on commit cbd800b

Please sign in to comment.