Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

refactor(list): drop WorktreeState's unused string serialization (#4065)

Worktrunk Botc6747857c0a9
diff --git a/src/commands/list/model/state.rs b/src/commands/list/model/state.rs
index 232791990..2582779c0 100644
--- a/src/commands/list/model/state.rs
+++ b/src/commands/list/model/state.rs
@@ -87,9 +87,8 @@ impl Divergence {
/// `Detached` gets a glyph of its own because nothing else in the row says
/// so: the Branch cell holds a short hash, which reads as a branch named
/// like one until the column tells you otherwise.
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, strum::IntoStaticStr)]
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum WorktreeState {
- #[strum(serialize = "")]
/// Normal worktree (path matches template, not locked or prunable)
#[default]
None,
@@ -538,6 +537,9 @@ mod tests {
assert_eq!(format!("{}", WorktreeState::BranchWorktreeMismatch), "⚑");
// Shares the mismatch glyph; the JSON state names which cause it was.
assert_eq!(format!("{}", WorktreeState::DuplicateBranch), "⚑");
+ // Its own glyph: the Branch cell holds a short hash, which reads as a
+ // branch named like one until this column says otherwise.
+ assert_eq!(format!("{}", WorktreeState::Detached), "⊘");
assert_eq!(format!("{}", WorktreeState::Prunable), "⊟");
assert_eq!(format!("{}", WorktreeState::Locked), "⊞");
assert_eq!(format!("{}", WorktreeState::Branch), "/");