Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2014-06-18 07:06:28 +0400
committerEdward Thomson <ethomson@microsoft.com>2014-06-19 02:24:01 +0400
commit4bc48574ec64f635ff861cf95d2503248b5a31cb (patch)
tree209991f601d319a47332717c8da527cc2a407a92 /LibGit2Sharp.Tests
parent6bfe4abeeb36fd96cdd1d539c75da4c7eabac43e (diff)
Remove conflicts in Index.Remove
Diffstat (limited to 'LibGit2Sharp.Tests')
-rw-r--r--LibGit2Sharp.Tests/ConflictFixture.cs9
-rw-r--r--LibGit2Sharp.Tests/RemoveFixture.cs2
2 files changed, 3 insertions, 8 deletions
diff --git a/LibGit2Sharp.Tests/ConflictFixture.cs b/LibGit2Sharp.Tests/ConflictFixture.cs
index 23ba4f45..9a98bd1b 100644
--- a/LibGit2Sharp.Tests/ConflictFixture.cs
+++ b/LibGit2Sharp.Tests/ConflictFixture.cs
@@ -51,6 +51,8 @@ namespace LibGit2Sharp.Tests
[InlineData(false, "ancestor-and-ours.txt", true, true, FileStatus.Removed |FileStatus.Untracked, 2)]
[InlineData(true, "ancestor-and-theirs.txt", true, false, FileStatus.Nonexistent, 2)]
[InlineData(false, "ancestor-and-theirs.txt", true, true, FileStatus.Untracked, 2)]
+ [InlineData(true, "ancestor-only.txt", false, false, FileStatus.Nonexistent, 1)]
+ [InlineData(false, "ancestor-only.txt", false, false, FileStatus.Nonexistent, 1)]
[InlineData(true, "conflicts-one.txt", true, false, FileStatus.Removed, 3)]
[InlineData(false, "conflicts-one.txt", true, true, FileStatus.Removed | FileStatus.Untracked, 3)]
[InlineData(true, "conflicts-two.txt", true, false, FileStatus.Removed, 3)]
@@ -61,13 +63,6 @@ namespace LibGit2Sharp.Tests
[InlineData(false, "ours-only.txt", true, true, FileStatus.Removed | FileStatus.Untracked, 1)]
[InlineData(true, "theirs-only.txt", true, false, FileStatus.Nonexistent, 1)]
[InlineData(false, "theirs-only.txt", true, true, FileStatus.Untracked, 1)]
- /* Conflicts clearing through Index.Remove() only works when a version of the entry exists in the workdir.
- * This is because libgit2's git_iterator_for_index() seem to only care about stage level 0.
- * Corrolary: other cases only work out of sheer luck (however, the behaviour is stable, so I guess we
- * can rely on it for the moment.
- * [InlineData(true, "ancestor-only.txt", false, false, FileStatus.Nonexistent, 0)]
- * [InlineData(false, "ancestor-only.txt", false, false, FileStatus.Nonexistent, 0)]
- */
public void CanResolveConflictsByRemovingFromTheIndex(
bool removeFromWorkdir, string filename, bool existsBeforeRemove, bool existsAfterRemove, FileStatus lastStatus, int removedIndexEntries)
{
diff --git a/LibGit2Sharp.Tests/RemoveFixture.cs b/LibGit2Sharp.Tests/RemoveFixture.cs
index 6dc6507c..04d12fee 100644
--- a/LibGit2Sharp.Tests/RemoveFixture.cs
+++ b/LibGit2Sharp.Tests/RemoveFixture.cs
@@ -180,7 +180,7 @@ namespace LibGit2Sharp.Tests
Assert.Throws<ArgumentException>(() => repo.Index.Remove(string.Empty));
Assert.Throws<ArgumentNullException>(() => repo.Index.Remove((string)null));
Assert.Throws<ArgumentException>(() => repo.Index.Remove(new string[] { }));
- Assert.Throws<ArgumentException>(() => repo.Index.Remove(new string[] { null }));
+ Assert.Throws<ArgumentNullException>(() => repo.Index.Remove(new string[] { null }));
}
}
}