[backend/configuration] Allow accessing full commit hash when available

This commit is contained in:
Laura Hausmann 2024-05-24 22:47:36 +02:00
parent 816e912078
commit 9fa414d738
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -15,8 +15,9 @@ public sealed class Config
public sealed class InstanceSection
{
public readonly string Version;
public readonly string Codename;
public readonly string Version;
public readonly string Codename;
public readonly string? CommitHash;
public InstanceSection()
{
@ -39,8 +40,9 @@ public sealed class Config
// If we have a git revision, limit it to 10 characters
if (version.Split('+') is { Length: 2 } split)
{
split[1] = split[1][..Math.Min(split[1].Length, 10)];
Version = string.Join('+', split);
split[1] = split[1][..Math.Min(split[1].Length, 10)];
Version = string.Join('+', split);
CommitHash = split[1];
}
else
{