feat(protocol): destination-state itemize for dirs/symlinks; --stats deleted breakdown

This commit is contained in:
2026-09-23 21:52:40 +02:00
parent cb2979fdf1
commit 29f8be161c
20 changed files with 761 additions and 99 deletions
+9 -6
View File
@@ -990,9 +990,11 @@ static void server_run_mt_receiver(ServerSession* state) {
server-contacting --dry-run deletes nothing (no manifest is sent). */
if (context->deferred_manifest) {
size_t deleted = 0;
DeletePathObserver observer = config->report_deletes ? receiver_record_deleted_path : NULL;
DeleteCommitResult deletion = manifest_delete_all_observed(
config, context->deferred_manifest, &deleted, observer, (void*)context->deleted_paths);
ReceiverDeleteContext delctx = {&context->stats, context->deleted_paths};
DeletePathObserver observer =
(delctx.stats || delctx.deleted_paths) ? receiver_record_deleted_path : NULL;
DeleteCommitResult deletion = manifest_delete_all_observed(config, context->deferred_manifest,
&deleted, observer, &delctx);
context->stats.deleted_files += deleted;
if (deletion == DELETE_COMMIT_ERROR) {
transfer_ok = false;
@@ -1010,9 +1012,10 @@ static void server_run_mt_receiver(ServerSession* state) {
if (context->deferred_plans) {
/* Defence in depth (the enclosing block already excludes dry-run): a
-n run never commits a deletion. */
if (config->report_deletes)
delete_plan_session_set_delete_observer(
context->deferred_plans, receiver_record_deleted_path, (void*)context->deleted_paths);
ReceiverDeleteContext delctx = {&context->stats, context->deleted_paths};
if (delctx.stats || delctx.deleted_paths)
delete_plan_session_set_delete_observer(context->deferred_plans,
receiver_record_deleted_path, &delctx);
DeleteCommitResult deletion =
config->dry_run ? DELETE_COMMIT_OK
: delete_plan_session_commit(context->deferred_plans, config);