Skip to content

Commit 4a0df57

Browse files
committed
git_futils_rmdir: only allow EBUSY when asked
Only ignore `EBUSY` from `rmdir` when the `GIT_RMDIR_SKIP_NONEMPTY` bit is set.
1 parent 83989d7 commit 4a0df57

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fileops.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,9 @@ static int futils__rmdir_empty_parent(void *opaque, const char *path)
766766

767767
if (en == ENOENT || en == ENOTDIR) {
768768
/* do nothing */
769+
} else if ((data->flags & GIT_RMDIR_SKIP_NONEMPTY) == 0 &&
770+
en == EBUSY) {
771+
error = git_path_set_error(errno, path, "rmdir");
769772
} else if (en == ENOTEMPTY || en == EEXIST || en == EBUSY) {
770773
error = GIT_ITEROVER;
771774
} else {

0 commit comments

Comments
 (0)