(7f772a7) Repair a Status field that lags its directory on mv, and bump to 0.32.6
This commit is contained in:
+34
-1
@@ -651,8 +651,41 @@ pub fn cmd_mv(
|
||||
}
|
||||
|
||||
if current_status == target_status {
|
||||
// `current_status` is read off the directory, so this comparison is the field's
|
||||
// only chance to be seen. A ticket whose file sits here and whose Status field
|
||||
// says something else is a hand-moved file or a partial restore, and refusing it
|
||||
// as a no-op left a repair nobody could reach without moving the file away and
|
||||
// back; the mirror case, where the field leads the directory after a crash in
|
||||
// move_ticket_file, is what the next real mv corrects.
|
||||
let recorded = parse_ticket_field(&resolved, "Status");
|
||||
|
||||
if recorded == target_status {
|
||||
println!(
|
||||
"Ticket is already in '{}' status.",
|
||||
color_text(target_status, Color::Orange)
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// The repair is not a move, so none of what gates one applies: not `-f`, which
|
||||
// overrides transitions, and not the dependency guards behind it. Only the field
|
||||
// is rewritten — no stamp, because the work arrived nowhere new, and no history
|
||||
// entry, because an entry shaped like a transition would record a journey the
|
||||
// ticket never took.
|
||||
let corrected = set_status_field(&resolved, target_status, &title)?;
|
||||
save_ticket(
|
||||
&worklane_dir,
|
||||
¤t_status,
|
||||
&parse_ticket_field(&resolved, "ID"),
|
||||
&title,
|
||||
None,
|
||||
&corrected,
|
||||
)?;
|
||||
|
||||
println!(
|
||||
"Ticket is already in '{}' status.",
|
||||
"Corrected Status field on '{}': said {}, but the file sits in {}.",
|
||||
color_text(&title, Color::Green),
|
||||
color_text(&recorded, Color::Orange),
|
||||
color_text(target_status, Color::Orange)
|
||||
);
|
||||
return Ok(());
|
||||
|
||||
Reference in New Issue
Block a user