From abab2ce8873384a2649fda29297572b624a5e266 Mon Sep 17 00:00:00 2001 From: Fabian Liebig Date: Fri, 7 Feb 2025 07:57:21 +0100 Subject: [PATCH] Update ResultMetadata branch attribute to allow None values for detached head state --- benchmarks/result/metadata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/result/metadata.py b/benchmarks/result/metadata.py index 10eb53d39..e777f89f0 100644 --- a/benchmarks/result/metadata.py +++ b/benchmarks/result/metadata.py @@ -4,7 +4,7 @@ import git from attrs import define, field -from attrs.validators import instance_of +from attrs.validators import instance_of, optional from cattrs.gen import make_dict_unstructure_fn from benchmarks.serialization import BenchmarkSerialization, converter @@ -26,7 +26,7 @@ class ResultMetadata(BenchmarkSerialization): latest_baybe_tag: str = field(validator=instance_of(str), init=False) """The latest BayBE tag reachable in the ancestor commit history.""" - branch: str = field(validator=instance_of(str), init=False) + branch: str | None = field(validator=optional(instance_of(str)), init=False) """The branch checked out during benchmark execution.""" @branch.default