This commit is contained in:
Bernat Borràs Civil 2025-04-11 16:52:01 +02:00
parent 75b15c455e
commit f8faf1ba26
2 changed files with 0 additions and 4 deletions

View file

@ -8,7 +8,6 @@ namespace SourceGit.Commands
{ {
WorkingDirectory = repo; WorkingDirectory = repo;
Context = repo; Context = repo;
// Use shortstat for faster results, which is enough for our needs
Args = $"show --shortstat --oneline {sha}"; Args = $"show --shortstat --oneline {sha}";
_pattern = new Regex(@"(\d+) files? changed(?:, (\d+) insertions?\(\+\))?(?:, (\d+) deletions?\(-\))?"); _pattern = new Regex(@"(\d+) files? changed(?:, (\d+) insertions?\(\+\))?(?:, (\d+) deletions?\(-\))?");
} }

View file

@ -66,15 +66,12 @@ namespace SourceGit.Views
{ {
base.OnDataContextChanged(e); base.OnDataContextChanged(e);
// When the DataContext changes, we need to re-evaluate any bindings
// This ensures that when the Commit property changes, the UI is updated
if (DataContext is ViewModels.CommitDetail detail) if (DataContext is ViewModels.CommitDetail detail)
{ {
detail.PropertyChanged += (s, e) => detail.PropertyChanged += (s, e) =>
{ {
if (e.PropertyName == nameof(detail.Commit)) if (e.PropertyName == nameof(detail.Commit))
{ {
// Force UI update for the commit lines
InvalidateVisual(); InvalidateVisual();
} }
}; };