commit - ab847d68d0785fd5821a5d9f8fe702a45a2db402
commit + 26c4ac4df0a7fa02e8cb703d2f0e6b9da84d0f82
blob - a728112ef99a5c737f7c452c927196b2e2bc58e0
blob + 9bba7429cae02b605411470a6ff9d8716e1292ab
--- lib/worktree.c
+++ lib/worktree.c
else {
char *parent = dirname(ondisk_path);
while (parent && strcmp(parent, a->root_path) != 0) {
- if (rmdir(parent) == -1 && errno != ENOTEMPTY) {
- err = got_error_from_errno();
+ if (rmdir(parent) == -1) {
+ if (errno != ENOTEMPTY)
+ err = got_error_from_errno();
break;
}
parent = dirname(parent);