From 4a0df574114f331a2428278c5f72aae7a49fa214 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sat, 10 Jun 2017 18:46:35 +0100 Subject: git_futils_rmdir: only allow `EBUSY` when asked Only ignore `EBUSY` from `rmdir` when the `GIT_RMDIR_SKIP_NONEMPTY` bit is set. --- src/fileops.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fileops.c b/src/fileops.c index f9552a5f8..2f86ba1e4 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -766,6 +766,9 @@ static int futils__rmdir_empty_parent(void *opaque, const char *path) if (en == ENOENT || en == ENOTDIR) { /* do nothing */ + } else if ((data->flags & GIT_RMDIR_SKIP_NONEMPTY) == 0 && + en == EBUSY) { + error = git_path_set_error(errno, path, "rmdir"); } else if (en == ENOTEMPTY || en == EEXIST || en == EBUSY) { error = GIT_ITEROVER; } else { -- cgit v1.2.1