#include "cache.h"
#include "object.h"
#include "replace-object.h"
+#include "object-store.h"
#include "blob.h"
#include "tree.h"
#include "commit.h"
* Look up the record for the given sha1 in the hash map stored in
* obj_hash. Return NULL if it was not found.
*/
-struct object *lookup_object(const unsigned char *sha1)
+struct object *lookup_object_the_repository(const unsigned char *sha1)
{
unsigned int i, first;
struct object *obj;
return obj;
}
-void *object_as_type(struct object *obj, enum object_type type, int quiet)
+void *object_as_type_the_repository(struct object *obj, enum object_type type, int quiet)
{
if (obj->type == type)
return obj;
struct object *lookup_unknown_object(const unsigned char *sha1)
{
- struct object *obj = lookup_object(sha1);
+ struct object *obj = lookup_object(the_repository, sha1);
if (!obj)
obj = create_object(the_repository, sha1,
alloc_object_node(the_repository));
return obj;
}
-struct object *parse_object_buffer(const struct object_id *oid, enum object_type type, unsigned long size, void *buffer, int *eaten_p)
+struct object *parse_object_buffer_the_repository(const struct object_id *oid, enum object_type type, unsigned long size, void *buffer, int *eaten_p)
{
struct object *obj;
*eaten_p = 0;
struct object *parse_object_or_die(const struct object_id *oid,
const char *name)
{
- struct object *o = parse_object(oid);
+ struct object *o = parse_object(the_repository, oid);
if (o)
return o;
die(_("unable to parse object: %s"), name ? name : oid_to_hex(oid));
}
-struct object *parse_object(const struct object_id *oid)
+struct object *parse_object_the_repository(const struct object_id *oid)
{
unsigned long size;
enum object_type type;
void *buffer;
struct object *obj;
- obj = lookup_object(oid->hash);
+ obj = lookup_object(the_repository, oid->hash);
if (obj && obj->parsed)
return obj;
return NULL;
}
parse_blob_buffer(lookup_blob(oid), NULL, 0);
- return lookup_object(oid->hash);
+ return lookup_object(the_repository, oid->hash);
}
buffer = read_object_file(oid, &type, &size);
return NULL;
}
- obj = parse_object_buffer(oid, type, size, buffer, &eaten);
+ obj = parse_object_buffer(the_repository, oid, type, size,
+ buffer, &eaten);
if (!eaten)
free(buffer);
return obj;
o->tag_state = allocate_alloc_state();
o->object_state = allocate_alloc_state();
+ o->is_shallow = -1;
+ o->shallow_stat = xcalloc(1, sizeof(*o->shallow_stat));
+
return o;
}