Code

t/README: start testing porcelainish
[git.git] / object.h
index f4ee2e55ba7853e3b49cbca7409c89b71d4b848f..6f23a9a18099cbc9fdc827f53843b1157dd10935 100644 (file)
--- a/object.h
+++ b/object.h
@@ -4,14 +4,23 @@
 struct object_list {
        struct object *item;
        struct object_list *next;
-       const char *name;
 };
 
 struct object_refs {
        unsigned count;
+       struct object *base;
        struct object *ref[FLEX_ARRAY]; /* more */
 };
 
+struct object_array {
+       unsigned int nr;
+       unsigned int alloc;
+       struct object_array_entry {
+               struct object *item;
+               const char *name;
+       } *objects;
+};
+
 #define TYPE_BITS   3
 #define FLAG_BITS  27
 
@@ -28,7 +37,6 @@ struct object {
        unsigned type : TYPE_BITS;
        unsigned flags : FLAG_BITS;
        unsigned char sha1[20];
-       struct object_refs *refs;
 };
 
 extern int track_object_refs;
@@ -41,6 +49,8 @@ static inline const char *typename(unsigned int type)
        return type_names[type > TYPE_TAG ? TYPE_BAD : type];
 }
 
+extern struct object_refs *lookup_object_refs(struct object *);
+
 /** Internal only **/
 struct object *lookup_object(const unsigned char *sha1);
 
@@ -70,4 +80,7 @@ unsigned object_list_length(struct object_list *list);
 
 int object_list_contains(struct object_list *list, struct object *obj);
 
+/* Object array handling .. */
+void add_object_array(struct object *obj, const char *name, struct object_array *array);
+
 #endif /* OBJECT_H */