-static int index_fd(const char *path, int namelen, struct cache_entry *ce, int fd, struct stat *st)
-{
- z_stream stream;
- unsigned long size = st->st_size;
- int max_out_bytes = namelen + size + 200;
- void *out = malloc(max_out_bytes);
- void *metadata = malloc(namelen + 200);
- void *in;
- SHA_CTX c;
-
- in = "";
- if (size)
- in = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
- close(fd);
- if (!out || (int)(long)in == -1)
- return -1;
+/*
+ * update-cache --refresh may not touch anything at all, in which case
+ * writing 1.6MB of the same thing is a waste.
+ */
+static int cache_changed = 0;