Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typo in ParentEnumerator.MoveNext and added corresponding tests #693

Merged
merged 1 commit into from Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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