From 855466686dab79b4936a669082ffde6ebb47acda Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 10 Mar 2025 10:22:49 +0800 Subject: [PATCH 1/3] ux: show conflict sources when it comes from a stash or patch (#1067) Signed-off-by: leo --- src/ViewModels/Conflict.cs | 5 +++++ src/Views/WorkingCopy.axaml | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/ViewModels/Conflict.cs b/src/ViewModels/Conflict.cs index 153a8d4f..03c09e8a 100644 --- a/src/ViewModels/Conflict.cs +++ b/src/ViewModels/Conflict.cs @@ -49,6 +49,11 @@ Theirs = merge.Source; Mine = repo.CurrentBranch; } + else + { + Theirs = "Stash or Patch"; + Mine = repo.CurrentBranch; + } } public void UseTheirs() diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index e5728df2..926bce6e 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -239,6 +239,13 @@ + + + + + + + From df6cbcaa2873f60b3ab9d6c1de5f6a4deedfe1e4 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 10 Mar 2025 11:33:38 +0800 Subject: [PATCH 2/3] 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); }); } From c1c0e7b2a0f459669f59d073bec172d8600f032b Mon Sep 17 00:00:00 2001 From: Gadfly Date: Mon, 10 Mar 2025 12:04:19 +0800 Subject: [PATCH 3/3] enhance: Save Preferences after switched Workspace and closed Preferences (#1073) --- src/ViewModels/Launcher.cs | 1 + src/Views/Preferences.axaml.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/ViewModels/Launcher.cs b/src/ViewModels/Launcher.cs index 6761eccf..06479394 100644 --- a/src/ViewModels/Launcher.cs +++ b/src/ViewModels/Launcher.cs @@ -525,6 +525,7 @@ namespace SourceGit.ViewModels } _ignoreIndexChange = false; + Preferences.Instance.Save(); GC.Collect(); } diff --git a/src/Views/Preferences.axaml.cs b/src/Views/Preferences.axaml.cs index 4696b4a7..8f9917be 100644 --- a/src/Views/Preferences.axaml.cs +++ b/src/Views/Preferences.axaml.cs @@ -189,6 +189,7 @@ namespace SourceGit.Views new Commands.Config(null).Set($"gpg.{GPGFormat.Value}.program", GPGExecutableFile); } + ViewModels.Preferences.Instance.Save(); base.OnClosing(e); }