fix(delete): guard per-dir missing-args by server policy; fall back for --dirs

- Only honor the --delete-missing-args exact paths when the server's
  --allow-delete policy left delete_missing_args set.
- -d/--dirs does not recurse, so a per-directory plan would carry no child
  information and could delete the contents of an untraversed directory; fall
  back to the whole-tree end-of-transfer commit for that mode.
This commit is contained in:
2026-09-16 23:26:14 +02:00
parent d6295d62ce
commit e771cc9da6
2 changed files with 12 additions and 4 deletions
+3 -1
View File
@@ -718,7 +718,9 @@ static bool apply_missing(DeletePlanSession* session, const Config* config) {
if (session->missing_applied)
return true;
session->missing_applied = true;
if (session->missing->size == 0)
/* The server clears delete_missing_args when its --allow-delete policy is
off; never honor the client's exact-path requests then. */
if (!config->delete_missing_args || session->missing->size == 0)
return true;
DeleteManifest manifest = {
.keeps = NULL, .protected = NULL, .missing = session->missing, .dirs = NULL};