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:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user