quality: decompose delete_walk_fd and delete_missing_args_budgeted_observed #325

Closed
opened 2026-09-23 02:10:50 +02:00 by TapTap · 1 comment
Owner

src/shared/delete.c:197-415 (delete_walk_fd, 219 lines) duplicates the child-walk block and the trailing-slash construction; src/shared/delete_commit.c:218-376 (delete_missing_args_budgeted_observed, 159 lines) mixes validation, skip-prefix protection, secure parent walking, --max-delete accounting, removal, recursion, and observers.

Work: extract delete_walk_child(), a with_trailing_slash() helper, delete_one_missing_arg(), and delete_nonempty_missing_dir().

`src/shared/delete.c:197-415` (`delete_walk_fd`, 219 lines) duplicates the child-walk block and the trailing-slash construction; `src/shared/delete_commit.c:218-376` (`delete_missing_args_budgeted_observed`, 159 lines) mixes validation, skip-prefix protection, secure parent walking, `--max-delete` accounting, removal, recursion, and observers. **Work:** extract `delete_walk_child()`, a `with_trailing_slash()` helper, `delete_one_missing_arg()`, and `delete_nonempty_missing_dir()`.
TapTap added the quality label 2026-09-23 02:10:50 +02:00
Author
Owner

Fixed in PR #329. delete_walk_fd is now a thin driver over delete_walk_child/with_trailing_slash/pass helpers; delete_missing_args_budgeted_observed is a thin loop over delete_one_missing_arg/delete_nonempty_missing_dir with a MissingArgStep preserving the original control flow. Behavior-preserving. Closing as completed.

Fixed in PR #329. `delete_walk_fd` is now a thin driver over `delete_walk_child`/`with_trailing_slash`/pass helpers; `delete_missing_args_budgeted_observed` is a thin loop over `delete_one_missing_arg`/`delete_nonempty_missing_dir` with a `MissingArgStep` preserving the original control flow. Behavior-preserving. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#325