GitSharp.Core.RevWalk.ObjectWalk.checkConnectivity C# (CSharp) Method

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
        public void checkConnectivity()
        {
            while (true)
            {
                RevCommit c = next();
                if (c == null) break;
            }

            while (true)
            {
                RevObject o = nextObject();
                if (o == null) break;

                if (o is RevBlob && !Repository.HasObject(o))
                {
                    throw new MissingObjectException(o, Constants.TYPE_BLOB);
                }
            }
        }

Usage Example

コード例 #1
0
ファイル: FetchProcess.cs プロジェクト: jagregory/GitSharp
 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);
     }
 }
All Usage Examples Of GitSharp.Core.RevWalk.ObjectWalk::checkConnectivity