Remove empty directories in recursive merge
[gitweb.git] / builtin-merge-recursive.c
index 43e55bf90154c51b94527b2ab7eb7c60fe36e9ec..f628a62751d25d394c722bbc03f9367d3973fdd0 100644 (file)
@@ -444,10 +444,8 @@ static int remove_file(int clean, const char *path, int no_wd)
                        return -1;
        }
        if (update_working_directory) {
-               unlink(path);
-               if (errno != ENOENT || errno != EISDIR)
+               if (remove_path(path) && errno != ENOENT)
                        return -1;
-               remove_path(path);
        }
        return 0;
 }