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

Include merge commits in the file history #2044

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions LibGit2Sharp.Tests/FileHistoryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ public void CanFollowBranches(string specificRepoPath)
var timeCommits = new List<Commit>
{
master10, // master

master9, // merge to master
master8, // master
nextfix7, // next-fix
master6, // master

master5, // merge to master
master4, // master
fix3, // fix
master2, // master
Expand All @@ -123,11 +123,11 @@ public void CanFollowBranches(string specificRepoPath)
var topoCommits = new List<Commit>
{
master10, // master

master9, // merge to master
nextfix7, // next-fix
master8, // master
master6, // master

master5, // merge to master
fix3, // fix
fix1, // fix
master4, // master
Expand Down
7 changes: 1 addition & 6 deletions LibGit2Sharp/Core/FileHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,7 @@ private static IEnumerable<LogEntry> FullHistory(IRepository repo, string path,
{
DetermineParentPaths(repo, currentCommit, currentPath, map);

if (parentCount != 1)
{
continue;
}

var parentCommit = currentCommit.Parents.Single();
var parentCommit = currentCommit.Parents.First();
var parentPath = map[parentCommit];
var parentTreeEntry = parentCommit.Tree[parentPath];

Expand Down