Skip to content

Commit

Permalink
Merge pull request #693 from GlebChili/three-parants-commit-fix
Browse files Browse the repository at this point in the history
Fixed typo in ParentEnumerator.MoveNext and added corresponding tests
  • Loading branch information
AArnott committed Nov 23, 2021
2 parents 60710ab + b3ff215 commit 806360a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using Nerdbank.GitVersioning.ManagedGit;
using Xunit;

Expand Down Expand Up @@ -31,5 +32,22 @@ public void ReadTest()
// Committer and commit message are not read
}
}

[Fact]
public void ReadCommitWithThreeParents()
{
using (Stream stream = TestUtilities.GetEmbeddedResource(@"ManagedGit\commit-ab39e8acac105fa0db88514f259341c9f0201b22"))
{
var commit = GitCommitReader.Read(stream, GitObjectId.Parse("ab39e8acac105fa0db88514f259341c9f0201b22"), readAuthor: true);

Assert.Equal(3, commit.Parents.Count());

Assert.Collection(
commit.Parents,
c => Assert.Equal("e0b4d66ef7915417e04e88d5fa173185bb940029", c.ToString()),
c => Assert.Equal("10e67ce38fbee44b3f5584d4f9df6de6c5f4cc5c", c.ToString()),
c => Assert.Equal("a7fef320334121af85dce4b9b731f6c9a9127cfd", c.ToString()));
}
}
}
}
@@ -0,0 +1,28 @@
tree 0f118b0345501ba18c15e149c9ae49ce07352485
parent e0b4d66ef7915417e04e88d5fa173185bb940029
parent 10e67ce38fbee44b3f5584d4f9df6de6c5f4cc5c
parent a7fef320334121af85dce4b9b731f6c9a9127cfd
author Atsushi Eno <atsushieno@gmail.com> 1278350964 -0000
committer Atsushi Eno <atsushieno@gmail.com> 1278350964 -0000

2010-07-05 Atsushi Enomoto <atsushi@ximian.com>

* ChannelDispatcher.cs :
moved IChannelDispatcherBoundListener from HttpChannelListener.cs.

* SvcHttpHandler.cs : removed old code and #if blocks.

* HttpStandaloneReplyChannel.cs
HttpStandaloneRequestContext.cs
HttpStandaloneChannelListener.cs
HttpReplyChannel.cs
HttpRequestContext.cs
HttpChannelListener.cs : renamed former 3 files to latter 3 files.

* System.ServiceModel.dll.sources :
renamed new HTTP channel listener implementation sources, and
removed old sources.



svn path=/trunk/mcs/; revision=159913
2 changes: 1 addition & 1 deletion src/NerdBank.GitVersioning/ManagedGit/GitCommit.cs
Expand Up @@ -164,7 +164,7 @@ public bool MoveNext()
{
0 => this.owner.FirstParent.HasValue,
1 => this.owner.SecondParent.HasValue,
_ => this.owner.AdditionalParents?.Count >= this.position - 2,
_ => this.owner.AdditionalParents?.Count > this.position - 2,
};
}

Expand Down

0 comments on commit 806360a

Please sign in to comment.