From 06cf18d9c7812bb21e88e42c089bb5ab2842d5bb Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 23 Aug 2022 08:17:45 +0200 Subject: [PATCH] Honor --noop for type change of target directory If we are running under --noop and a target directory would be replaced by another file type, we currently delete the target directory, although the actual replacement is not installed because of --noop. Do not remove to-be-replaced directory when --noop is selected. --- cmirror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmirror.c b/cmirror.c index 575f291..55f89e1 100644 --- a/cmirror.c +++ b/cmirror.c @@ -515,7 +515,7 @@ static void add_clean_dir(char *dir) { } static void out_of_the_way(FileInfo *fi) { - if (fi->type == 'D') { + if (fi->type == 'D' && !fileop_noop) { char *deleteme = g_strdup_printf("%s.deleteme", fi->name); fileop_mv(fi->name, deleteme); CLEAN_DIRS = g_slist_prepend(CLEAN_DIRS, deleteme);