Ejemplo n.º 1
0
		/// <exception cref="System.IO.IOException"></exception>
		private void FinishVisitTree(TreeEntry t1, TreeEntry t2, int curIndexPos)
		{
			if (t1 != null && t1.GetParent() == null)
			{
				t1 = null;
			}
			if (t2 != null && t2.GetParent() == null)
			{
				t2 = null;
			}
			FilePath f = null;
			string c = null;
			if (t1 != null)
			{
				c = t1.GetFullName();
				f = new FilePath(root, c);
			}
			else
			{
				if (t2 != null)
				{
					c = t2.GetFullName();
					f = new FilePath(root, c);
				}
			}
			if (t1 is Tree || t2 is Tree)
			{
				if (threeTrees)
				{
					visitor.FinishVisitTree((Tree)t1, (Tree)t2, c);
				}
				else
				{
					visitor.FinishVisitTree((Tree)t1, indexCounter - curIndexPos, c);
				}
			}
			else
			{
				if (t1 != null || t2 != null)
				{
					if (threeTrees)
					{
						visitor.VisitEntry(t1, t2, null, f);
					}
					else
					{
						visitor.VisitEntry(t1, null, f);
					}
				}
			}
		}
Ejemplo n.º 2
0
		internal static int Compare(TreeEntry t1, TreeEntry t2)
		{
			if (t1 != null && t1.GetParent() == null && t2 != null && t2.GetParent() == null)
			{
				return 0;
			}
			if (t1 != null && t1.GetParent() == null)
			{
				return -1;
			}
			if (t2 != null && t2.GetParent() == null)
			{
				return 1;
			}
			if (t1 == null && t2 == null)
			{
				return 0;
			}
			if (t1 == null)
			{
				return 1;
			}
			if (t2 == null)
			{
				return -1;
			}
			return Tree.CompareNames(t1.GetFullNameUTF8(), t2.GetFullNameUTF8(), TreeEntry.LastChar
				(t1), TreeEntry.LastChar(t2));
		}
Ejemplo n.º 3
0
		/// <exception cref="System.IO.IOException"></exception>
		private void VisitEntry(TreeEntry t1, TreeEntry t2, GitIndex.Entry i)
		{
			// assert t1 != null || t2 != null || i != null :
			// org.eclipse.jgit.JGitText.get().needsAtLeastOneEntry;
			// assert root != null : JGitText.get().needsWorkdir;
			if (t1 != null && t1.GetParent() == null)
			{
				t1 = null;
			}
			if (t2 != null && t2.GetParent() == null)
			{
				t2 = null;
			}
			FilePath f = null;
			if (i != null)
			{
				f = new FilePath(root, i.GetName());
			}
			else
			{
				if (t1 != null)
				{
					f = new FilePath(root, t1.GetFullName());
				}
				else
				{
					if (t2 != null)
					{
						f = new FilePath(root, t2.GetFullName());
					}
				}
			}
			if (t1 != null || t2 != null || i != null)
			{
				if (threeTrees)
				{
					visitor.VisitEntry(t1, t2, i, f);
				}
				else
				{
					visitor.VisitEntry(t1, i, f);
				}
			}
		}