From 4aad6a7f8610db2e3b57449f44e316e4c177b0e8 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 29 Nov 2024 10:26:36 +0800 Subject: [PATCH] fix: `System.ArgumentException` when hover the commit link multiple times before the first time tooltip shows (#765) --- src/ViewModels/CherryPick.cs | 1 - src/Views/CommitMessagePresenter.cs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/CherryPick.cs b/src/ViewModels/CherryPick.cs index ea601d5a..19dac059 100644 --- a/src/ViewModels/CherryPick.cs +++ b/src/ViewModels/CherryPick.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Text; using System.Threading.Tasks; namespace SourceGit.ViewModels diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index 7ca823dc..a767b395 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -296,7 +296,8 @@ namespace SourceGit.Views if (currentParent is { DataContext: ViewModels.CommitDetail currentDetail } && currentDetail.Commit.SHA == lastDetailCommit) { - _inlineCommits.Add(sha, c); + if (!_inlineCommits.ContainsKey(sha)) + _inlineCommits.Add(sha, c); // Make sure user still hovers the target SHA. if (_lastHover == link && c != null)