switch: reject if some operation is in progress
[gitweb.git] / builtin / prune.c
index 04b657394575168da1eb0bbe7974863145281ad7..97613eccb54dcba31d9fb35df54673fdf1f57817 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->hash);
+       return obj && (obj->flags & SEEN);
 }
 
 static int prune_object(const struct object_id *oid, const char *fullpath,