From 8e4402592574d630cdb5ab4f55a1b7131802ff72 Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Sun, 2 Apr 2006 14:44:09 +0200 Subject: Use blob_, commit_, tag_, and tree_type throughout. This replaces occurences of "blob", "commit", "tag", and "tree", where they're really used as type specifiers, which we already have defined global constants for. Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- pack-objects.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'pack-objects.c') diff --git a/pack-objects.c b/pack-objects.c index ccfaa5f609..4145f25305 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", -- cgit v1.2.3