projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge part of pack-thin branch
[git.git]
/
pack-objects.c
diff --git
a/pack-objects.c
b/pack-objects.c
index
32befa0
..
8da8aab
100644
(file)
--- a/
pack-objects.c
+++ b/
pack-objects.c
@@
-470,7
+470,7
@@
static int add_object_entry(const unsigned char *sha1, const char *name, int exc
struct packed_git *p;
unsigned int found_offset = 0;
struct packed_git *found_pack = NULL;
struct packed_git *p;
unsigned int found_offset = 0;
struct packed_git *found_pack = NULL;
- int ix;
+ int ix
, status = 0
;
if (!exclude) {
for (p = packed_git; p; p = p->next) {
if (!exclude) {
for (p = packed_git; p; p = p->next) {
@@
-516,6
+516,7
@@
static int add_object_entry(const unsigned char *sha1, const char *name, int exc
die("internal error in object hashing.");
object_ix[-1 - ix] = idx + 1;
}
die("internal error in object hashing.");
object_ix[-1 - ix] = idx + 1;
}
+ status = 1;
already_added:
if (progress_update) {
already_added:
if (progress_update) {
@@
-530,7
+531,7
@@
static int add_object_entry(const unsigned char *sha1, const char *name, int exc
entry->in_pack_offset = found_offset;
}
}
entry->in_pack_offset = found_offset;
}
}
- return
1
;
+ return
status
;
}
static void add_pbase_tree(struct tree_desc *tree)
}
static void add_pbase_tree(struct tree_desc *tree)
@@
-548,7
+549,10
@@
static void add_pbase_tree(struct tree_desc *tree)
continue;
if (sha1_object_info(sha1, type, &size))
continue;
continue;
if (sha1_object_info(sha1, type, &size))
continue;
- add_object_entry(sha1, name, 1);
+
+ if (!add_object_entry(sha1, name, 1))
+ continue;
+
if (!strcmp(type, "tree")) {
struct tree_desc sub;
void *elem;
if (!strcmp(type, "tree")) {
struct tree_desc sub;
void *elem;
@@
-570,8
+574,8
@@
static void add_preferred_base(unsigned char *sha1)
tree.buf = elem;
if (!tree.buf)
return;
tree.buf = elem;
if (!tree.buf)
return;
- add_object_entry(sha1, "", 1);
- add_pbase_tree(&tree);
+ if (add_object_entry(sha1, "", 1))
+
add_pbase_tree(&tree);
free(elem);
}
free(elem);
}
@@
-800,7
+804,7
@@
static int try_delta(struct unpacked *cur, struct unpacked *old, unsigned max_de
* already have a delta based on preferred
* one is pointless.
*/
* already have a delta based on preferred
* one is pointless.
*/
- return
0
;
+ return
-1
;
}
else if (!old_preferred)
max_size = cur_entry->delta_size-1;
}
else if (!old_preferred)
max_size = cur_entry->delta_size-1;