aboutsummaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-06-28 18:22:06 -0700
committerJunio C Hamano <gitster@pobox.com>2018-06-29 10:43:39 -0700
commita962da1ef59c71b6b18f71aeb25f1edaa99769f6 (patch)
tree365978e443f24a9c44e7495d73f1a5c3b3f994c2 /object.c
parenttag: add repository argument to deref_tag (diff)
downloadgit-a962da1ef59c71b6b18f71aeb25f1edaa99769f6.tar.xz
git-a962da1ef59c71b6b18f71aeb25f1edaa99769f6.zip
object: allow object_as_type to handle arbitrary repositories
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r--object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/object.c b/object.c
index e095d49b379..f41f82c6725 100644
--- a/object.c
+++ b/object.c
@@ -158,13 +158,13 @@ void *create_object(struct repository *r, const unsigned char *sha1, void *o)
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)
- ((struct commit *)obj)->index = alloc_commit_index(the_repository);
+ ((struct commit *)obj)->index = alloc_commit_index(r);
obj->type = type;
return obj;
}