model: fix stale Ents-Ref references left by the Advance-ref rename
commit
5120874model: fix stale Ents-Ref references left by the Advance-ref rename
64263f8 renamed the reserved trailer from Ents-Ref to Advance-ref but
missed a doc comment in ents-model and two in ents-gate, plus a test
case in ents-model that still asserted the old key name — the last of
which failed under cargo nextest run --workspace.
Reviews
No reviews of this commit yet — record a verdict below.
Start a review
crates/ents-gate/src/verify.rs
@@ -64,7 +64,7 @@
/// semantics — no commit-supplied timestamp participates) and whose
/// provenance authorizes this refname (`model.member-provenance`,
/// `effect.admin-only`).
-/// 2. `gate.refname-binding` — the commit's `Ents-Ref:` trailer names
+/// 2. `gate.refname-binding` — the commit's `Advance-ref:` trailer names
/// exactly this ref.
/// 3. `gate.fast-forward` — the new tip descends from the current tip.
///
@@ -229,7 +229,7 @@
let found = trailers
.ents_ref
.as_ref()
- .map_or_else(|| "no Ents-Ref trailer".to_owned(), |n| n.to_string());
+ .map_or_else(|| "no Advance-ref trailer".to_owned(), |n| n.to_string());
return refuse(
Requirement::RefnameBinding,
format!(
@@ -396,7 +396,7 @@
return Ok(Verdict::Fail(Refusal {
requirement: Requirement::RefnameBinding,
refname: update.name.clone(),
- detail: "the enrollment commit's Ents-Ref trailer does not name this ref".into(),
+ detail: "the enrollment commit's Advance-ref trailer does not name this ref".into(),
inbox_alternative: false,
}));
}
crates/ents-model/src/lib.rs
@@ -72,7 +72,7 @@
//! assert_eq!(refname.as_bstr(), "refs/meta/member/jdc");
//!
//! // The commit that would write it binds itself to that ref via the
-//! // reserved `Ents-Ref:` trailer (`meta-ref.trailers`).
+//! // reserved `Advance-ref:` trailer (`meta-ref.trailers`).
//! let trailers = Trailers {
//! ents_ref: Some(refname),
//! schema_version: None,
crates/ents-model/src/trailer.rs
@@ -129,7 +129,7 @@
)]
#[case::neither(b"Subject\n\nJust a body, no trailers.\n", None, None)]
#[case::case_insensitive_key(
- b"Subject\n\nents-ref: refs/meta/comments/1\n",
+ b"Subject\n\nadvance-ref: refs/meta/comments/1\n",
Some("refs/meta/comments/1"),
None
)]