- SHA1_Update(&c, &hdr, offsetof(struct cache_header, sha1));
- for (i = 0; i < entries; i++) {
- struct cache_entry *ce = cache[i];
- int size = ce_size(ce);
- SHA1_Update(&c, ce, size);
- }
- SHA1_Final(hdr.sha1, &c);
-
- if (ce_write(newfd, &hdr, sizeof(hdr)) < 0)
+ if (ce_write(&c, newfd, &hdr, sizeof(hdr)) < 0)