Skip to content

Commit 755bd18

Browse files
committed
include merge commits in the file history
1 parent 8c32b61 commit 755bd18

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

LibGit2Sharp.Tests/FileHistoryFixture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ public void CanFollowBranches(string specificRepoPath)
104104
var timeCommits = new List<Commit>
105105
{
106106
master10, // master
107-
107+
master9, // merge to master
108108
master8, // master
109109
nextfix7, // next-fix
110110
master6, // master
111-
111+
master5, // merge to master
112112
master4, // master
113113
fix3, // fix
114114
master2, // master
@@ -123,11 +123,11 @@ public void CanFollowBranches(string specificRepoPath)
123123
var topoCommits = new List<Commit>
124124
{
125125
master10, // master
126-
126+
master9, // merge to master
127127
nextfix7, // next-fix
128128
master8, // master
129129
master6, // master
130-
130+
master5, // merge to master
131131
fix3, // fix
132132
fix1, // fix
133133
master4, // master

LibGit2Sharp/Core/FileHistory.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,7 @@ private static IEnumerable<LogEntry> FullHistory(IRepository repo, string path,
134134
{
135135
DetermineParentPaths(repo, currentCommit, currentPath, map);
136136

137-
if (parentCount != 1)
138-
{
139-
continue;
140-
}
141-
142-
var parentCommit = currentCommit.Parents.Single();
137+
var parentCommit = currentCommit.Parents.First();
143138
var parentPath = map[parentCommit];
144139
var parentTreeEntry = parentCommit.Tree[parentPath];
145140

0 commit comments

Comments
 (0)