X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=pack-objects.c;fp=pack-objects.c;h=4145f2530501dd80c6ec8a26465bd45f2e258f17;hb=8e4402592574d630cdb5ab4f55a1b7131802ff72;hp=ccfaa5f609431490c886abe0e0af842987428bf6;hpb=fc9957b0052df6a8248420395bc9febd66194252;p=git.git diff --git a/pack-objects.c b/pack-objects.c index ccfaa5f6..4145f253 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -1,5 +1,9 @@ #include "cache.h" #include "object.h" +#include "blob.h" +#include "commit.h" +#include "tag.h" +#include "tree.h" #include "delta.h" #include "pack.h" #include "csum-file.h" @@ -603,7 +607,7 @@ static void add_pbase_tree(struct tree_desc *tree, struct name_path *up) if (!add_object_entry(sha1, hash, 1)) continue; - if (!strcmp(type, "tree")) { + if (!strcmp(type, tree_type)) { struct tree_desc sub; void *elem; struct name_path me; @@ -626,7 +630,7 @@ static void add_preferred_base(unsigned char *sha1) struct tree_desc tree; void *elem; - elem = read_object_with_reference(sha1, "tree", &tree.size, NULL); + elem = read_object_with_reference(sha1, tree_type, &tree.size, NULL); tree.buf = elem; if (!tree.buf) return; @@ -684,13 +688,13 @@ static void check_object(struct object_entry *entry) die("unable to get type of object %s", sha1_to_hex(entry->sha1)); - if (!strcmp(type, "commit")) { + if (!strcmp(type, commit_type)) { entry->type = OBJ_COMMIT; - } else if (!strcmp(type, "tree")) { + } else if (!strcmp(type, tree_type)) { entry->type = OBJ_TREE; - } else if (!strcmp(type, "blob")) { + } else if (!strcmp(type, blob_type)) { entry->type = OBJ_BLOB; - } else if (!strcmp(type, "tag")) { + } else if (!strcmp(type, tag_type)) { entry->type = OBJ_TAG; } else die("unable to pack object %s of type %s",