From df6cbcaa2873f60b3ab9d6c1de5f6a4deedfe1e4 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 10 Mar 2025 11:33:38 +0800 Subject: [PATCH] fix: app crashed after enable `Show children in the commit details` (#1072) Signed-off-by: leo --- src/Commands/QueryCommitChildren.cs | 2 +- src/ViewModels/CommitDetail.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs index bef09abb..d1bced52 100644 --- a/src/Commands/QueryCommitChildren.cs +++ b/src/Commands/QueryCommitChildren.cs @@ -12,7 +12,7 @@ namespace SourceGit.Commands Args = $"rev-list -{max} --parents --branches --remotes ^{commit}"; } - public IEnumerable Result() + public List Result() { Exec(); return _lines; diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index a4f3f595..456e99f8 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -615,7 +615,7 @@ namespace SourceGit.ViewModels 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)); + Dispatcher.UIThread.Post(() => Children = children); }); }