From 755bd18c48ae284902414b9ad2777471b7bc8528 Mon Sep 17 00:00:00 2001
From: emanuel-v-r <imavalverde@gmail.com>
Date: Mon, 19 Jun 2023 14:29:14 +0100
Subject: [PATCH] include merge commits in the file history

---
 LibGit2Sharp.Tests/FileHistoryFixture.cs | 8 ++++----
 LibGit2Sharp/Core/FileHistory.cs         | 7 +------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/LibGit2Sharp.Tests/FileHistoryFixture.cs b/LibGit2Sharp.Tests/FileHistoryFixture.cs
index e6465d1ac..da58f88e4 100644
--- a/LibGit2Sharp.Tests/FileHistoryFixture.cs
+++ b/LibGit2Sharp.Tests/FileHistoryFixture.cs
@@ -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
@@ -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
diff --git a/LibGit2Sharp/Core/FileHistory.cs b/LibGit2Sharp/Core/FileHistory.cs
index 5c10a1a24..0f345b72a 100644
--- a/LibGit2Sharp/Core/FileHistory.cs
+++ b/LibGit2Sharp/Core/FileHistory.cs
@@ -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];