@@ -165,15 +165,6 @@ bool TryCalculateHeight(GitCommit commit)
165165
166166 var ignoreCase = repository . IgnoreCase ;
167167
168- /*
169- bool ContainsRelevantChanges(IEnumerable<TreeEntryChanges> changes) =>
170- excludePaths.Count == 0
171- ? changes.Any()
172- // If there is a single change that isn't excluded,
173- // then this commit is relevant.
174- : changes.Any(change => !excludePaths.Any(exclude => exclude.Excludes(change.Path, ignoreCase)));
175- */
176-
177168 int height = 1 ;
178169
179170 if ( pathFilters != null )
@@ -194,26 +185,6 @@ bool ContainsRelevantChanges(IEnumerable<TreeEntryChanges> changes) =>
194185 }
195186 }
196187
197- /*
198- // If there are no include paths, or any of the include
199- // paths refer to the root of the repository, then do not
200- // filter the diff at all.
201- var diffInclude =
202- includePaths.Count == 0 || pathFilters.Any(filter => filter.IsRoot)
203- ? null
204- : includePaths;
205-
206- // If the diff between this commit and any of its parents
207- // does not touch a path that we care about, don't bump the
208- // height.
209- var relevantCommit =
210- commit.Parents.Any()
211- ? commit.Parents.Any(parent => ContainsRelevantChanges(commit.GetRepository().Diff
212- .Compare<TreeChanges>(parent.Tree, commit.Tree, diffInclude, DiffOptions)))
213- : ContainsRelevantChanges(commit.GetRepository().Diff
214- .Compare<TreeChanges>(null, commit.Tree, diffInclude, DiffOptions));
215- */
216-
217188 if ( ! relevantCommit )
218189 {
219190 height = 0 ;
@@ -268,7 +239,8 @@ private static bool IsRelevantCommit(GitRepository repository, GitTree tree, Git
268239
269240 bool isRelevant =
270241 // Either there are no include filters at all (i.e. everything is included), or there's an explicit include filter
271- ( ! filters . Any ( f => f . IsInclude ) || filters . Any ( f => f . Includes ( fullPath , repository . IgnoreCase ) ) )
242+ ( ! filters . Any ( f => f . IsInclude ) || filters . Any ( f => f . Includes ( fullPath , repository . IgnoreCase ) )
243+ || ( ! entry . IsFile && filters . Any ( f => f . IncludesChildren ( fullPath , repository . IgnoreCase ) ) ) )
272244 // The path is not excluded by any filters
273245 && ! filters . Any ( f => f . Excludes ( fullPath , repository . IgnoreCase ) ) ;
274246
0 commit comments