enhance: check commit hash after intersect testing

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-03-05 09:30:38 +08:00
parent 71d0b69eee
commit 5e898a809e
No known key found for this signature in database

View file

@ -665,11 +665,6 @@ namespace SourceGit.ViewModels
if (!sha.Success)
continue;
var hash = sha.Groups[1].Value;
var test = new Commands.IsCommitSHA(_repo.FullPath, hash).Result();
if (!test)
continue;
var start = sha.Index;
var len = sha.Length;
var intersect = false;
@ -682,7 +677,12 @@ namespace SourceGit.ViewModels
}
}
if (!intersect)
if (intersect)
continue;
var hash = sha.Groups[1].Value;
var isCommitSHA = new Commands.IsCommitSHA(_repo.FullPath, hash).Result();
if (isCommitSHA)
links.Add(new Models.Hyperlink(start, len, hash, true));
}