diff --git a/lib/copymitter.js b/lib/copymitter.js
index <HASH>..<HASH> 100644
--- a/lib/copymitter.js
+++ b/lib/copymitter.js
@@ -143,7 +143,7 @@
         fs.stat(from, function(error, stat) {
             if (!is(error))
                 fs.unlink(to, function(error) {
-                    if (error && /^E(ISDIR|NOENT$)/.test(error.code))
+                    if (error && !/^E(ISDIR|NOENT)$/.test(error.code))
                         fn(error);
                     else
                         make(stat.mode);
fix(copymitter) unlink: regexp