diff options
-rw-r--r-- | src/update.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/update.c b/src/update.c index 73ab142c1..dd48bfe78 100644 --- a/src/update.c +++ b/src/update.c @@ -243,9 +243,16 @@ updateInDirectory(struct directory *directory, const char *name) } else if (S_ISDIR(st.st_mode)) { struct directory *subdir = directory_get_child(directory, name); if (subdir) { + enum update_return ret; + assert(directory == subdir->parent); directory_set_stat(subdir, &st); - return updateDirectory(subdir); + + ret = updateDirectory(subdir); + if (ret == UPDATE_RETURN_ERROR) + delete_directory(subdir); + + return ret; } else { return addSubDirectoryToDirectory(directory, name, &st); } |