Skip to content

Commit 3fb1c76

Browse files
committed
feature: use repository filters to limit children search
1 parent c611b62 commit 3fb1c76

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Commands/QueryCommitChildren.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ namespace SourceGit.Commands
55
{
66
public class QueryCommitChildren : Command
77
{
8-
public QueryCommitChildren(string repo, string commit)
8+
public QueryCommitChildren(string repo, string commit, string filters)
99
{
1010
WorkingDirectory = repo;
1111
Context = repo;
1212
_commit = commit;
13-
Args = $"rev-list --parents --all ^{commit}";
13+
if (string.IsNullOrEmpty(filters))
14+
filters = "--all";
15+
Args = $"rev-list --parents {filters} ^{commit}";
1416
}
1517

1618
public IEnumerable<string> Result()

src/ViewModels/CommitDetail.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ private void Refresh()
540540

541541
Task.Run(() =>
542542
{
543-
var children = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA).Result();
543+
var children = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, _repo.Settings.BuildHistoriesFilter()).Result();
544544
Dispatcher.UIThread.Invoke(() => Children.AddRange(children));
545545
});
546546

0 commit comments

Comments
 (0)