Ejemplo n.º 1
0
 /// <summary>Initialize the list iterator.</summary>
 /// <remarks>Initialize the list iterator.</remarks>
 /// <param name="walk">
 /// the revision pool the iterator will use when allocating the
 /// returned objects.
 /// </param>
 protected internal ObjectListIterator(ObjectWalk walk)
 {
     this.walk = walk;
 }
Ejemplo n.º 2
0
		private void ReleaseTreeVisit(ObjectWalk.TreeVisit tv)
		{
			tv.buf = null;
			tv.parent = freeVisit;
			freeVisit = tv;
		}
Ejemplo n.º 3
0
		protected internal override RevWalk CreateRevWalk()
		{
			return objw = new ObjectWalk(db);
		}
Ejemplo n.º 4
0
		private int UpdatePathBuf(ObjectWalk.TreeVisit tv)
		{
			if (tv == null)
			{
				return 0;
			}
			// If nameEnd == 0 this tree has not yet contributed an entry.
			// Update only for the parent, which if null will be empty.
			int nameEnd = tv.nameEnd;
			if (nameEnd == 0)
			{
				return UpdatePathBuf(tv.parent);
			}
			int ptr = tv.pathLen;
			if (ptr == 0)
			{
				ptr = UpdatePathBuf(tv.parent);
				if (ptr == pathBuf.Length)
				{
					GrowPathBuf(ptr);
				}
				if (ptr != 0)
				{
					pathBuf[ptr++] = (byte)('/');
				}
				tv.pathLen = ptr;
			}
			int namePtr = tv.namePtr;
			int nameLen = nameEnd - namePtr;
			int end = ptr + nameLen;
			while (pathBuf.Length < end)
			{
				GrowPathBuf(ptr);
			}
			System.Array.Copy(tv.buf, namePtr, pathBuf, ptr, nameLen);
			return end;
		}
Ejemplo n.º 5
0
		private static int ParseMode(byte[] buf, int startPtr, int recEndPtr, ObjectWalk.TreeVisit
			 tv)
		{
			int mode = buf[startPtr] - '0';
			for (; ; )
			{
				byte c = buf[++startPtr];
				if (' ' == c)
				{
					break;
				}
				mode <<= 3;
				mode += c - '0';
				c = buf[++startPtr];
				if (' ' == c)
				{
					break;
				}
				mode <<= 3;
				mode += c - '0';
				c = buf[++startPtr];
				if (' ' == c)
				{
					break;
				}
				mode <<= 3;
				mode += c - '0';
				c = buf[++startPtr];
				if (' ' == c)
				{
					break;
				}
				mode <<= 3;
				mode += c - '0';
				c = buf[++startPtr];
				if (' ' == c)
				{
					break;
				}
				mode <<= 3;
				mode += c - '0';
				c = buf[++startPtr];
				if (' ' == c)
				{
					break;
				}
				mode <<= 3;
				mode += c - '0';
				c = buf[++startPtr];
				if (' ' == c)
				{
					break;
				}
				mode <<= 3;
				mode += c - '0';
			}
			tv.ptr = recEndPtr;
			tv.namePtr = startPtr + 1;
			tv.nameEnd = recEndPtr - (ID_SZ + 1);
			return mode;
		}
Ejemplo n.º 6
0
 /// <exception cref="NGit.Errors.TransportException"></exception>
 private bool AskForIsComplete()
 {
     try
     {
         ObjectWalk ow = new ObjectWalk(transport.local);
         try
         {
             foreach (ObjectId want in askFor.Keys)
             {
                 ow.MarkStart(ow.ParseAny(want));
             }
             foreach (Ref @ref in transport.local.GetAllRefs().Values)
             {
                 ow.MarkUninteresting(ow.ParseAny(@ref.GetObjectId()));
             }
             ow.CheckConnectivity();
         }
         finally
         {
             ow.Release();
         }
         return true;
     }
     catch (MissingObjectException)
     {
         return false;
     }
     catch (IOException e)
     {
         throw new TransportException(JGitText.Get().unableToCheckConnectivity, e);
     }
 }
Ejemplo n.º 7
0
		/// <summary>Initialize the list iterator.</summary>
		/// <remarks>Initialize the list iterator.</remarks>
		/// <param name="walk">
		/// the revision pool the iterator will use when allocating the
		/// returned objects.
		/// </param>
		protected internal ObjectListIterator(ObjectWalk walk)
		{
			this.walk = walk;
		}
Ejemplo n.º 8
0
 protected internal override RevWalk CreateRevWalk()
 {
     return(objw = new ObjectWalk(db));
 }