packed_ref_cache: don't use mmap() for small files
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index e6814b9e9c6d6f49a48fb2d3234323e20dec5f56..1898dd307d40db131ba2378e22ed3efed1dc2520 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -3545,14 +3545,12 @@ int diff_populate_filespec(struct diff_filespec *s, unsigned int flags)
                int fd;
 
                if (lstat(s->path, &st) < 0) {
-                       if (errno == ENOENT) {
-                       err_empty:
-                               err = -1;
-                       empty:
-                               s->data = (char *)"";
-                               s->size = 0;
-                               return err;
-                       }
+               err_empty:
+                       err = -1;
+               empty:
+                       s->data = (char *)"";
+                       s->size = 0;
+                       return err;
                }
                s->size = xsize_t(st.st_size);
                if (!s->size)