Exemplo n.º 1
0
		/// <exception cref="System.IO.IOException"></exception>
		internal virtual void ProcessEntry(TreeEntry h, TreeEntry m, GitIndex.Entry i)
		{
			ObjectId iId = (i == null ? null : i.GetObjectId());
			ObjectId mId = (m == null ? null : m.GetId());
			ObjectId hId = (h == null ? null : h.GetId());
			string name = (i != null ? i.GetName() : (h != null ? h.GetFullName() : m.GetFullName
				()));
			if (i == null)
			{
				if (h == null)
				{
					updated.Put(name, mId);
				}
				else
				{
					if (m == null)
					{
						removed.AddItem(name);
					}
					else
					{
						updated.Put(name, mId);
					}
				}
			}
			else
			{
				if (h == null)
				{
					if (m == null || mId.Equals(iId))
					{
						if (HasParentBlob(merge, name))
						{
							if (i.IsModified(root, true))
							{
								conflicts.AddItem(name);
							}
							else
							{
								removed.AddItem(name);
							}
						}
					}
					else
					{
						conflicts.AddItem(name);
					}
				}
				else
				{
					if (m == null)
					{
						if (hId.Equals(iId))
						{
							if (i.IsModified(root, true))
							{
								conflicts.AddItem(name);
							}
							else
							{
								removed.AddItem(name);
							}
						}
						else
						{
							conflicts.AddItem(name);
						}
					}
					else
					{
						if (!hId.Equals(mId) && !hId.Equals(iId) && !mId.Equals(iId))
						{
							conflicts.AddItem(name);
						}
						else
						{
							if (hId.Equals(iId) && !mId.Equals(iId))
							{
								if (i.IsModified(root, true))
								{
									conflicts.AddItem(name);
								}
								else
								{
									updated.Put(name, mId);
								}
							}
						}
					}
				}
			}
		}
Exemplo n.º 2
0
			/// <exception cref="System.IO.IOException"></exception>
			public override void VisitEntry(TreeEntry m, GitIndex.Entry i, FilePath f)
			{
				// TODO remove this once we support submodules
				if (f.GetName().Equals(".gitmodules"))
				{
					throw new NotSupportedException(JGitText.Get().submodulesNotSupported);
				}
				if (m == null)
				{
					this._enclosing.index.Remove(this._enclosing.root, f);
					return;
				}
				bool needsCheckout = false;
				if (i == null)
				{
					needsCheckout = true;
				}
				else
				{
					if (i.GetObjectId().Equals(m.GetId()))
					{
						if (i.IsModified(this._enclosing.root, true))
						{
							needsCheckout = true;
						}
					}
					else
					{
						needsCheckout = true;
					}
				}
				if (needsCheckout)
				{
					GitIndex.Entry newEntry = this._enclosing.index.AddEntry(m);
					this._enclosing.index.CheckoutEntry(this._enclosing.root, newEntry);
				}
			}