Skip to content

Commit 5ed3eec

Browse files
[#99] Normalize BuildManifestHash casing when reading it for matching
1 parent ccfc50a commit 5ed3eec

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎Analyzer/Util/BuildHistoryHelper.cs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ public static List<string> FindBuildHashes(IEnumerable<string> files)
4141
.Where(File.Exists));
4242
}
4343

44-
return hashFiles.Select(f => File.ReadAllText(f).Trim()).Distinct().ToList();
44+
// Hashes are lowercase hex; normalizing here (and in TryReadBuildManifestHash) keeps all
45+
// hash comparisons simple, exact matches.
46+
return hashFiles.Select(f => File.ReadAllText(f).Trim().ToLowerInvariant()).Distinct().ToList();
4547
}
4648

4749
// Fallback signal used when no BuildManifestHash.txt is available: a .cf file marks
@@ -118,7 +120,7 @@ public static string TryReadBuildManifestHash(string contentLayoutPath)
118120
if (reader.TokenType == JsonToken.PropertyName && reader.Depth == 1 &&
119121
"BuildManifestHash".Equals(reader.Value))
120122
{
121-
return reader.ReadAsString();
123+
return reader.ReadAsString()?.ToLowerInvariant();
122124
}
123125
}
124126
}

0 commit comments

Comments
 (0)