Skip to content

Commit

Permalink
Honor --noop for type change of target directory
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Aug 23, 2022
1 parent b069db6 commit 06cf18d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 06cf18d

Please sign in to comment.