Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
object: allow object_as_type to handle arbitrary repositories
author
Stefan Beller
<sbeller@google.com>
Fri, 29 Jun 2018 01:22:06 +0000
(18:22 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 29 Jun 2018 17:43:39 +0000
(10:43 -0700)
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object.c
patch
|
blob
|
history
object.h
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
a74093d
)
diff --git
a/object.c
b/object.c
index e095d49b379e9d50a0ea6be80e3957298aea7a22..f41f82c6725e7bdbb4aa53d672863273abb48bf2 100644
(file)
--- a/
object.c
+++ b/
object.c
@@
-158,13
+158,13
@@
void *create_object(struct repository *r, const unsigned char *sha1, void *o)
return obj;
}
return obj;
}
-void *object_as_type
_the_repository(
struct object *obj, enum object_type type, int quiet)
+void *object_as_type
(struct repository *r,
struct object *obj, enum object_type type, int quiet)
{
if (obj->type == type)
return obj;
else if (obj->type == OBJ_NONE) {
if (type == OBJ_COMMIT)
{
if (obj->type == type)
return obj;
else if (obj->type == OBJ_NONE) {
if (type == OBJ_COMMIT)
- ((struct commit *)obj)->index = alloc_commit_index(
the_repository
);
+ ((struct commit *)obj)->index = alloc_commit_index(
r
);
obj->type = type;
return obj;
}
obj->type = type;
return obj;
}
diff --git
a/object.h
b/object.h
index 3faa89578fcf164679df8cae99a4b3be0469218a..6f3271eb228884052d5844edd71f8d9e597b1ea4 100644
(file)
--- a/
object.h
+++ b/
object.h
@@
-114,8
+114,7
@@
struct object *lookup_object_the_repository(const unsigned char *sha1);
extern void *create_object(struct repository *r, const unsigned char *sha1, void *obj);
extern void *create_object(struct repository *r, const unsigned char *sha1, void *obj);
-#define object_as_type(r, o, t, q) object_as_type_##r(o, t, q)
-void *object_as_type_the_repository(struct object *obj, enum object_type type, int quiet);
+void *object_as_type(struct repository *r, struct object *obj, enum object_type type, int quiet);
/*
* Returns the object, having parsed it to find out what it is.
/*
* Returns the object, having parsed it to find out what it is.