fix: git rev-list do not support --decorate-refs-exclude (#746)

Do not use histories filters to query commit children
This commit is contained in:
leo 2024-11-27 17:06:44 +08:00
parent d38d1b11e8
commit 1c0d8a2697
No known key found for this signature in database
2 changed files with 3 additions and 6 deletions

View file

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

View file

@ -576,8 +576,7 @@ namespace SourceGit.ViewModels
Task.Run(() => Task.Run(() =>
{ {
var max = Preference.Instance.MaxHistoryCommits; var max = Preference.Instance.MaxHistoryCommits;
var filter = _repo.Settings.BuildHistoriesFilter(); var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, max) { Cancel = _cancelToken };
var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, max, filter) { Cancel = _cancelToken };
var children = cmdChildren.Result(); var children = cmdChildren.Result();
if (!cmdChildren.Cancel.Requested) if (!cmdChildren.Cancel.Requested)
Dispatcher.UIThread.Post(() => Children.AddRange(children)); Dispatcher.UIThread.Post(() => Children.AddRange(children));