Skip to content

Commit

Permalink
Remove replaced directory even without --delete
Browse files Browse the repository at this point in the history
When a directory is replaced by another type (e.g. a plain file), it is
first renamed and later removed. This later removal should be done
regardless of whether --delete was selected or not.
  • Loading branch information
donald committed Aug 23, 2022
1 parent 06cf18d commit 85fdb78
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cmirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,18 +913,19 @@ static void slave(char *slave_path) {
fileop_rm(path);
}
}
GSList *d = CLEAN_DIRS;
while (d) {
char *path = (char *)d->data;
if (!quiet)
warn("rm -r %s\n", path);
fileop_rmdir_recurse(path);
d = d->next;
}
}
if (reduce)
return;

GSList *d = CLEAN_DIRS;
while (d) {
char *path = (char *)d->data;
if (!quiet)
warn("rm -r %s\n", path);
fileop_rmdir_recurse(path);
d = d->next;
}

DIR_MTIME_QUEUE = g_list_reverse(DIR_MTIME_QUEUE);
for (GList *e = DIR_MTIME_QUEUE ; e != NULL ; e = e->next ) {
DirMtime *mt = e->data;
Expand Down

0 comments on commit 85fdb78

Please sign in to comment.