aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--object.c13
-rw-r--r--object.h1
-rw-r--r--rev-list.c1
3 files changed, 12 insertions, 3 deletions
diff --git a/object.c b/object.c
index 63e6e784d..1fdebe012 100644
--- a/object.c
+++ b/object.c
@@ -9,6 +9,8 @@ struct object **objs;
int nr_objs;
static int obj_allocs;
+int track_object_refs = 1;
+
static int find_object(const unsigned char *sha1)
{
int first = 0, last = nr_objs;
@@ -67,9 +69,12 @@ void created_object(const unsigned char *sha1, struct object *obj)
void add_ref(struct object *refer, struct object *target)
{
- struct object_list **pp = &refer->refs;
- struct object_list *p;
-
+ struct object_list **pp, *p;
+
+ if (!track_object_refs)
+ return;
+
+ pp = &refer->refs;
while ((p = *pp) != NULL) {
if (p->item == target)
return;
@@ -87,6 +92,8 @@ void mark_reachable(struct object *obj, unsigned int mask)
{
struct object_list *p = obj->refs;
+ if (!track_object_refs)
+ die("cannot do reachability with object refs turned off");
/* If we've been here already, don't bother */
if (obj->flags & mask)
return;
diff --git a/object.h b/object.h
index bf744490a..6accda33d 100644
--- a/object.h
+++ b/object.h
@@ -17,6 +17,7 @@ struct object {
void *util;
};
+extern int track_object_refs;
extern int nr_objs;
extern struct object **objs;
diff --git a/rev-list.c b/rev-list.c
index 91534dd23..c55e912be 100644
--- a/rev-list.c
+++ b/rev-list.c
@@ -581,6 +581,7 @@ int main(int argc, char **argv)
}
save_commit_buffer = verbose_header;
+ track_object_refs = 0;
if (!merge_order) {
sort_by_date(&list);