8000 Add coverage for more FindMergeBases scenarios. · otac0n/libgit2sharp@ecd8fcf · GitHub
[go: up one dir, main page]

Skip to content

Commit ecd8fcf

Browse files
committed
Add coverage for more FindMergeBases scenarios.
1 parent e470838 commit ecd8fcf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

LibGit2Sharp.Tests/CommitAncestorFixture.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Threading;
45
using LibGit2Sharp.Tests.TestHelpers;
56
using Xunit;
67
using Xunit.Extensions;
@@ -9,6 +10,8 @@ namespace LibGit2Sharp.Tests
910
{
1011
public class CommitAncestorFixture : BaseFixture
1112
{
13+
private static int orphans;
14+
1215
/*
1316
* BareTestRepoPath structure
1417
*
@@ -28,7 +31,7 @@ public class CommitAncestorFixture : BaseFixture
28< 8000 code>31
* |
2932
* * commit 8496071c1b46c854b31185ea97743be6a877447
3033
*
31-
*/
34+
*/
3235

3336
[Theory]
3437
[InlineData("5b5b025afb0b4c913b4c338a42934a3863bf3644", "c47800c", "9fd738e")]
@@ -88,6 +91,8 @@ public void FindCommonAncestorForCommitsAsEnumerable(string result, string[] sha
8891

8992
[Theory]
9093
[InlineData(new[] { "0350717031bebea6b2600b89a33159935541cee1", "ebc932c47f8800bffdd150c560e111d87bb74f4f" }, new[] { "152325a", "c9a2051" })]
94+
[InlineData(new[] { "0350717031bebea6b2600b89a33159935541cee1", "ebc932c47f8800bffdd150c560e111d87bb74f4f" }, new[] { "152325a", "c9a2051", "-" })]
95+
[InlineData(new string[0], new[] { "-", "-" })]
9196
public void FindCommonAncestorsForCommitsAsEnumerable(string[] results, string[] shas)
9297
{
9398
string path = SandboxCrossHistoryRepo();
@@ -140,7 +145,7 @@ private static Commit CreateOrphanedCommit(IRepository repo)
140145
Commit orphanedCommit = repo.ObjectDatabase.CreateCommit(
141146
random.Author,
142147
random.Committer,
143-
"This is a test commit created by 'CommitFixture.CannotFindCommonAncestorForCommmitsWithoutCommonAncestor'",
148+
string.Format("This is a test commit (#{0}) created by 'CommitFixture.CannotFindCommonAncestorForCommmitsWithoutCommonAncestor'", Interlocked.Increment(ref orphans)),
144149
random.Tree,
145150
Enumerable.Empty<Commit>(),
146151
false);

0 commit comments

Comments
 (0)
0