feature: use repository filters to limit children search

This commit is contained in:
Dmitrij D. Czarkoff 2024-11-16 21:26:03 +01:00
parent c611b62992
commit 3fb1c763f3
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View file

@ -5,12 +5,14 @@ namespace SourceGit.Commands
{ {
public class QueryCommitChildren : Command public class QueryCommitChildren : Command
{ {
public QueryCommitChildren(string repo, string commit) public QueryCommitChildren(string repo, string commit, string filters)
{ {
WorkingDirectory = repo; WorkingDirectory = repo;
Context = repo; Context = repo;
_commit = commit; _commit = commit;
Args = $"rev-list --parents --all ^{commit}"; if (string.IsNullOrEmpty(filters))
filters = "--all";
Args = $"rev-list --parents {filters} ^{commit}";
} }
public IEnumerable<string> Result() public IEnumerable<string> Result()

View file

@ -540,7 +540,7 @@ namespace SourceGit.ViewModels
Task.Run(() => 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)); Dispatcher.UIThread.Invoke(() => Children.AddRange(children));
}); });