You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rewrite git-stash-tidy's hand-rolled clean loop to delegate iterate/filter/act/aggregate to the shared git_tidy_core::clean::run_clean seam (issue #118 step 3). The public run_clean signature and CleanResult<DroppedStash> return type are unchanged, so no callers or tests needed edits. The should_clean classification filter becomes the pure, silent decide predicate (Decision::Clean/Skip), and a single act closure owns the tool-specific work: dry-run-vs-real branching, the verbatim "would drop {ref} in {group}" / "dropped {ref} in {group}" / "error: could not drop {ref}" wording, the git.stash_drop call, and construction of the success record (Outcome::Cleaned) or failure record (Outcome::Failed(FailedItem)). run_clean is invoked once per repo group so each repo's output stays contiguous, with succeeded/failed/skipped accumulated across groups.
Descending-drop-order is preserved by pre-sorting each group's stashes by descending stash@{N} index before the call, in the new order_group_items helper, because the shared loop preserves input order. Admitted stashes (should_clean true and a parseable index) sort high-index-first so dropping stash@{2} never renumbers a lower pending index; should_clean-rejected stashes are retained so the loop still counts them as skipped; and stashes that would be cleaned but whose ref does not parse are excluded entirely, exactly as the original loop silently ignored them. The index parsing reuses the unchanged parse_stash_index. clean_drops_in_descending_order and every other unit and integration test pass unchanged.
Refs #118
0 commit comments