Example #1
0
		/// <exception cref="NGit.Errors.MissingObjectException"></exception>
		/// <exception cref="NGit.Errors.IncorrectObjectTypeException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		private void MarkTreeUninteresting(RevTree tree)
		{
			if ((tree.flags & UNINTERESTING) != 0)
			{
				return;
			}
			tree.flags |= UNINTERESTING;
			treeWalk = treeWalk.ResetRoot(reader, tree);
			while (!treeWalk.Eof)
			{
				FileMode mode = treeWalk.EntryFileMode;
				int sType = mode.GetObjectType();
				switch (sType)
				{
					case Constants.OBJ_BLOB:
					{
						treeWalk.GetEntryObjectId(idBuffer);
						LookupBlob(idBuffer).flags |= UNINTERESTING;
						break;
					}

					case Constants.OBJ_TREE:
					{
						treeWalk.GetEntryObjectId(idBuffer);
						RevTree t = LookupTree(idBuffer);
						if ((t.flags & UNINTERESTING) == 0)
						{
							t.flags |= UNINTERESTING;
							treeWalk = treeWalk.CreateSubtreeIterator0(reader, t);
							continue;
						}
						break;
					}

					default:
					{
						if (FileMode.GITLINK.Equals(mode))
						{
							break;
						}
						treeWalk.GetEntryObjectId(idBuffer);
						throw new CorruptObjectException(MessageFormat.Format(JGitText.Get().corruptObjectInvalidMode3
							, mode, idBuffer.Name, treeWalk.EntryPathString, tree));
					}
				}
				treeWalk = treeWalk.Next();
			}
		}