sha1_file: pass empty buffer to index empty file
[gitweb.git] / sha1_file.c
index a38854ce553c1e59294d5542a37a5404ccd66dc5..6e2d6ec65b7e80f8e8800380146f4ba61cead190 100644 (file)
@@ -3119,7 +3119,7 @@ static int index_core(unsigned char *sha1, int fd, size_t size,
        int ret;
 
        if (!size) {
-               ret = index_mem(sha1, NULL, size, type, path, flags);
+               ret = index_mem(sha1, "", size, type, path, flags);
        } else if (size <= SMALL_FILE_SIZE) {
                char *buf = xmalloc(size);
                if (size == read_in_full(fd, buf, size))