code_style: rename some variables in ParseLinksInMessage

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-03-05 17:06:45 +08:00
parent 991ebe4082
commit 81bbe11345
No known key found for this signature in database

View file

@ -658,15 +658,15 @@ namespace SourceGit.ViewModels
rule.Matches(links, message); rule.Matches(links, message);
} }
var shas = REG_SHA_FORMAT().Matches(message); var matches = REG_SHA_FORMAT().Matches(message);
for (int i = 0; i < shas.Count; i++) for (int i = 0; i < matches.Count; i++)
{ {
var sha = shas[i]; var match = matches[i];
if (!sha.Success) if (!match.Success)
continue; continue;
var start = sha.Index; var start = match.Index;
var len = sha.Length; var len = match.Length;
var intersect = false; var intersect = false;
foreach (var link in links) foreach (var link in links)
{ {
@ -680,10 +680,10 @@ namespace SourceGit.ViewModels
if (intersect) if (intersect)
continue; continue;
var hash = sha.Groups[1].Value; var sha = match.Groups[1].Value;
var isCommitSHA = new Commands.IsCommitSHA(_repo.FullPath, hash).Result(); var isCommitSHA = new Commands.IsCommitSHA(_repo.FullPath, sha).Result();
if (isCommitSHA) if (isCommitSHA)
links.Add(new Models.Hyperlink(start, len, hash, true)); links.Add(new Models.Hyperlink(start, len, sha, true));
} }
if (links.Count > 0) if (links.Count > 0)