Sync with maint
[gitweb.git] / builtin / prune.c
index 04b657394575168da1eb0bbe7974863145281ad7..2b76872ad2207857077f4ecf285780e94388d00d 100644 (file)
@@ -49,13 +49,12 @@ static void perform_reachability_traversal(struct rev_info *revs)
 static int is_object_reachable(const struct object_id *oid,
                               struct rev_info *revs)
 {
+       struct object *obj;
+
        perform_reachability_traversal(revs);
 
-       /*
-        * Do we know about this object?
-        * It must have been reachable
-        */
-       return !!lookup_object(the_repository, oid->hash);
+       obj = lookup_object(the_repository, oid);
+       return obj && (obj->flags & SEEN);
 }
 
 static int prune_object(const struct object_id *oid, const char *fullpath,