Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-02-26 22:56:00 +0300
committerJunio C Hamano <junkio@cox.net>2007-02-27 12:34:21 +0300
commit0ab179504a17907c395a4009f7c23d2f71bba1d3 (patch)
tree0bdd9634b1bb7a5cb31c2f871259cf737f5c6278 /object.c
parent21666f1aae4e890d8f50924f9e80763b27e6a45d (diff)
get rid of lookup_object_type()
This function is called only once in the whole source tree. Let's move its code inline instead, which is also in the spirit of removing as much object type char arrays as possible (not that this patch does anything for that but at least it is now a local matter). Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'object.c')
-rw-r--r--object.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/object.c b/object.c
index 0e67af33bf..5b46889342 100644
--- a/object.c
+++ b/object.c
@@ -120,24 +120,6 @@ void created_object(const unsigned char *sha1, struct object *obj)
nr_objs++;
}
-struct object *lookup_object_type(const unsigned char *sha1, const char *type)
-{
- if (!type) {
- return lookup_unknown_object(sha1);
- } else if (!strcmp(type, blob_type)) {
- return &lookup_blob(sha1)->object;
- } else if (!strcmp(type, tree_type)) {
- return &lookup_tree(sha1)->object;
- } else if (!strcmp(type, commit_type)) {
- return &lookup_commit(sha1)->object;
- } else if (!strcmp(type, tag_type)) {
- return &lookup_tag(sha1)->object;
- } else {
- error("Unknown type %s", type);
- return NULL;
- }
-}
-
union any_object {
struct object object;
struct commit commit;