Skip to content

Commit 806360a

Browse files
authored
Merge pull request #693 from GlebChili/three-parants-commit-fix
Fixed typo in ParentEnumerator.MoveNext and added corresponding tests
2 parents 60710ab + b3ff215 commit 806360a

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

src/NerdBank.GitVersioning.Tests/ManagedGit/GitCommitReaderTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.IO;
3+
using System.Linq;
34
using Nerdbank.GitVersioning.ManagedGit;
45
using Xunit;
56

@@ -31,5 +32,22 @@ public void ReadTest()
3132
// Committer and commit message are not read
3233
}
3334
}
35+
36+
[Fact]
37+
public void ReadCommitWithThreeParents()
38+
{
39+
using (Stream stream = TestUtilities.GetEmbeddedResource(@"ManagedGit\commit-ab39e8acac105fa0db88514f259341c9f0201b22"))
40+
{
41+
var commit = GitCommitReader.Read(stream, GitObjectId.Parse("ab39e8acac105fa0db88514f259341c9f0201b22"), readAuthor: true);
42+
43+
Assert.Equal(3, commit.Parents.Count());
44+
45+
Assert.Collection(
46+
commit.Parents,
47+
c => Assert.Equal("e0b4d66ef7915417e04e88d5fa173185bb940029", c.ToString()),
48+
c => Assert.Equal("10e67ce38fbee44b3f5584d4f9df6de6c5f4cc5c", c.ToString()),
49+
c => Assert.Equal("a7fef320334121af85dce4b9b731f6c9a9127cfd", c.ToString()));
50+
}
51+
}
3452
}
3553
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
tree 0f118b0345501ba18c15e149c9ae49ce07352485
2+
parent e0b4d66ef7915417e04e88d5fa173185bb940029
3+
parent 10e67ce38fbee44b3f5584d4f9df6de6c5f4cc5c
4+
parent a7fef320334121af85dce4b9b731f6c9a9127cfd
5+
author Atsushi Eno <[email protected]> 1278350964 -0000
6+
committer Atsushi Eno <[email protected]> 1278350964 -0000
7+
8+
2010-07-05 Atsushi Enomoto <[email protected]>
9+
10+
* ChannelDispatcher.cs :
11+
moved IChannelDispatcherBoundListener from HttpChannelListener.cs.
12+
13+
* SvcHttpHandler.cs : removed old code and #if blocks.
14+
15+
* HttpStandaloneReplyChannel.cs
16+
HttpStandaloneRequestContext.cs
17+
HttpStandaloneChannelListener.cs
18+
HttpReplyChannel.cs
19+
HttpRequestContext.cs
20+
HttpChannelListener.cs : renamed former 3 files to latter 3 files.
21+
22+
* System.ServiceModel.dll.sources :
23+
renamed new HTTP channel listener implementation sources, and
24+
removed old sources.
25+
26+
27+
28+
svn path=/trunk/mcs/; revision=159913

src/NerdBank.GitVersioning/ManagedGit/GitCommit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public bool MoveNext()
164164
{
165165
0 => this.owner.FirstParent.HasValue,
166166
1 => this.owner.SecondParent.HasValue,
167-
_ => this.owner.AdditionalParents?.Count >= this.position - 2,
167+
_ => this.owner.AdditionalParents?.Count > this.position - 2,
168168
};
169169
}
170170

0 commit comments

Comments
 (0)