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

markUninteresting() public method

Mark an object to not produce in the output. Uninteresting objects denote not just themselves but also their entire reachable chain, back until the merge base of an uninteresting commit and an otherwise interesting commit. Callers are encouraged to use RevWalk.parseAny(AnyObjectId) instead of RevWalk.lookupAny(AnyObjectId, int), as this method requires the object to be parsed before it can be added as a root for the traversal. The method will automatically parse an unparsed object, but error handling may be more difficult for the application to explain why a RevObject is not actually valid. The object pool of this walker would also be 'poisoned' by the invalid RevObject. This method will automatically call RevWalk.markStart(RevCommit) if passed RevCommit instance, or a RevTag that directly (or indirectly) references a RevCommit.
/// The object supplied is not available from the object /// database. This usually indicates the supplied object is /// invalid, but the reference was constructed during an earlier /// invocation to . /// /// The object was not parsed yet and it was discovered during /// parsing that it is not actually the type of the instance /// passed in. This usually indicates the caller used the wrong /// type in a call. /// /// A pack file or loose object could not be Read. ///
public markUninteresting ( RevObject o ) : void
o RevObject /// The object to start traversing from. The object passed must be /// from this same revision walker. ///
return void
        public void markUninteresting(RevObject o)
        {
            RevTag  oTag = ( o  as RevTag);
            while (oTag != null)
            {
                o.Flags |= UNINTERESTING;
                if (hasRevSort(RevSort.BOUNDARY))
                {
                    AddObject(o);
                }
                o = oTag.getObject();
                parseHeaders(o);
            }

            RevCommit oComm = (o as RevCommit);
            if (oComm != null)
            {
                base.markUninteresting(oComm);
            }
            else if (o is RevTree)
            {
                MarkTreeUninteresting(o);
            }
            else
            {
                o.Flags |= UNINTERESTING;
            }

            if (o.Type != Constants.OBJ_COMMIT && hasRevSort(RevSort.BOUNDARY))
            {
                AddObject(o);
            }
        }

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::markUninteresting