mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
code_review: PR #1055
- since the author and time are already shown in the blame view, use the full message as tooltip is better. - cache the commit message in `ViewModels.Blame` since the `Tooltip` of control may change. - querying commit message synchronously (it's very fast) to avoid similar issues in commit details panel. Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
269903503f
commit
fb8d4a2542
3 changed files with 17 additions and 43 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Avalonia.Threading;
|
||||
|
||||
|
@ -57,12 +58,18 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
public Models.Commit GetCommitInfo(string commitSHA)
|
||||
public string GetCommitMessage(string sha)
|
||||
{
|
||||
return new Commands.QuerySingleCommit(_repo, commitSHA).Result();
|
||||
if (_commitMessages.TryGetValue(sha, out var msg))
|
||||
return msg;
|
||||
|
||||
msg = new Commands.QueryCommitFullMessage(_repo, sha).Result();
|
||||
_commitMessages[sha] = msg;
|
||||
return msg;
|
||||
}
|
||||
|
||||
private readonly string _repo;
|
||||
private Models.BlameData _data = null;
|
||||
private Dictionary<string, string> _commitMessages = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue