checkConnectivity() public method

Verify all interesting objects are available, and reachable. Callers should populate starting points and ending points with markStart(RevObject) and markUninteresting(RevObject) and then use this method to verify all objects between those two points exist in the repository and are readable. This method returns successfully if everything is connected; it throws an exception if there is a connectivity problem. The exception message provides some detail about the connectivity failure.
/// One or or more of the next objects are not available from the /// object database, but were thought to be candidates for /// traversal. This usually indicates a broken link. /// /// One or or more of the objects in a tree do not match the type /// indicated. /// /// A pack file or loose object could not be Read. ///
public checkConnectivity ( ) : void
return void
示例#1
0
 private bool askForIsComplete()
 {
     try
     {
         using(ObjectWalk ow = new ObjectWalk(_transport.Local))
         {
             foreach (ObjectId want in _askFor.Keys)
             {
                 ow.markStart(ow.parseAny(want));
             }
             foreach (Ref @ref in _transport.Local.getAllRefs().Values)
             {
                 ow.markUninteresting(ow.parseAny(@ref.ObjectId));
             }
             ow.checkConnectivity();
             return true;
         }
     }
     catch (MissingObjectException)
     {
         return false;
     }
     catch (IOException e)
     {
         throw new TransportException("Unable to check connectivity.", e);
     }
 }
示例#2
0
 private void CheckConnectivity()
 {
     using(var ow = new ObjectWalk(db))
     {
         foreach (ReceiveCommand cmd in commands)
         {
             if (cmd.getResult() != ReceiveCommand.Result.NOT_ATTEMPTED) continue;
             if (cmd.getType() == ReceiveCommand.Type.DELETE) continue;
             ow.markStart(ow.parseAny(cmd.getNewId()));
         }
         foreach (Ref @ref in refs.Values)
         {
             ow.markUninteresting(ow.parseAny(@ref.ObjectId));
         }
         ow.checkConnectivity();
     }
 }