Disallow working directory commands in a bare repository.
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 2c2e9dcb8c83709df37d6d57bdfe13bb0e85c0ba..e1b016f47f8eb37a89bdb6cb98435bad7d9dc111 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1341,10 +1341,8 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
                fd = open(s->path, O_RDONLY);
                if (fd < 0)
                        goto err_empty;
-               s->data = mmap(NULL, s->size, PROT_READ, MAP_PRIVATE, fd, 0);
+               s->data = xmmap(NULL, s->size, PROT_READ, MAP_PRIVATE, fd, 0);
                close(fd);
-               if (s->data == MAP_FAILED)
-                       goto err_empty;
                s->should_munmap = 1;
        }
        else {