From 3fb1c763f3c98e0baa80534e5698d0fd945c1e85 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Sat, 16 Nov 2024 21:26:03 +0100 Subject: [PATCH] feature: use repository filters to limit children search --- src/Commands/QueryCommitChildren.cs | 6 ++++-- src/ViewModels/CommitDetail.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs index ec6057a3..bcf63fa5 100644 --- a/src/Commands/QueryCommitChildren.cs +++ b/src/Commands/QueryCommitChildren.cs @@ -5,12 +5,14 @@ namespace SourceGit.Commands { public class QueryCommitChildren : Command { - public QueryCommitChildren(string repo, string commit) + public QueryCommitChildren(string repo, string commit, string filters) { WorkingDirectory = repo; Context = repo; _commit = commit; - Args = $"rev-list --parents --all ^{commit}"; + if (string.IsNullOrEmpty(filters)) + filters = "--all"; + Args = $"rev-list --parents {filters} ^{commit}"; } public IEnumerable Result() diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 1d9495e4..f54ae5cb 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -540,7 +540,7 @@ namespace SourceGit.ViewModels Task.Run(() => { - var children = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA).Result(); + var children = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, _repo.Settings.BuildHistoriesFilter()).Result(); Dispatcher.UIThread.Invoke(() => Children.AddRange(children)); });