From 1c0d8a26972d9b70f53fc0b4e02d4a4e13b6d51c Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Nov 2024 17:06:44 +0800 Subject: [PATCH] fix: `git rev-list` do not support `--decorate-refs-exclude` (#746) Do not use histories filters to query commit children --- src/Commands/QueryCommitChildren.cs | 6 ++---- src/ViewModels/CommitDetail.cs | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs index 293de912..bef09abb 100644 --- a/src/Commands/QueryCommitChildren.cs +++ b/src/Commands/QueryCommitChildren.cs @@ -4,14 +4,12 @@ namespace SourceGit.Commands { public class QueryCommitChildren : Command { - public QueryCommitChildren(string repo, string commit, int max, string filters) + public QueryCommitChildren(string repo, string commit, int max) { WorkingDirectory = repo; Context = repo; _commit = commit; - if (string.IsNullOrEmpty(filters)) - filters = "--branches --remotes --tags"; - Args = $"rev-list -{max} --parents {filters} ^{commit}"; + Args = $"rev-list -{max} --parents --branches --remotes ^{commit}"; } public IEnumerable Result() diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 05b60e2f..f14b0359 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -576,8 +576,7 @@ namespace SourceGit.ViewModels Task.Run(() => { var max = Preference.Instance.MaxHistoryCommits; - var filter = _repo.Settings.BuildHistoriesFilter(); - var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, max, filter) { Cancel = _cancelToken }; + var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, max) { Cancel = _cancelToken }; var children = cmdChildren.Result(); if (!cmdChildren.Cancel.Requested) Dispatcher.UIThread.Post(() => Children.AddRange(children));