mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 05:05:00 +00:00
enhance: force using StringComparison.Ordinal
This commit is contained in:
parent
cd2ecb109a
commit
f6eb1281b5
12 changed files with 23 additions and 19 deletions
|
@ -360,14 +360,14 @@ namespace SourceGit.ViewModels {
|
|||
}
|
||||
|
||||
var content = new Commands.QueryFileContent(_repo, _commit.SHA, file.Path).Result();
|
||||
if (content.StartsWith("version https://git-lfs.github.com/spec/", StringComparison.OrdinalIgnoreCase)) {
|
||||
if (content.StartsWith("version https://git-lfs.github.com/spec/", StringComparison.Ordinal)) {
|
||||
var obj = new Models.RevisionLFSObject() { Object = new Models.LFSObject() };
|
||||
var lines = content.Split('\n', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (lines.Length == 3) {
|
||||
foreach (var line in lines) {
|
||||
if (line.StartsWith("oid sha256:")) {
|
||||
if (line.StartsWith("oid sha256:", StringComparison.Ordinal)) {
|
||||
obj.Object.Oid = line.Substring(11);
|
||||
} else if (line.StartsWith("size ")) {
|
||||
} else if (line.StartsWith("size ", StringComparison.Ordinal)) {
|
||||
obj.Object.Size = long.Parse(line.Substring(5));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue