* Did we write the wrong # entries in the header?
* If so, rewrite it like in fast-import
*/
- if (pack_to_stdout || nr_written == nr_remaining) {
- unsigned flags = pack_to_stdout ? CSUM_CLOSE : CSUM_FSYNC;
- sha1close(f, sha1, flags);
+ if (pack_to_stdout) {
+ sha1close(f, sha1, CSUM_CLOSE);
+ } else if (nr_written == nr_remaining) {
+ sha1close(f, sha1, CSUM_FSYNC);
} else {
int fd = sha1close(f, NULL, 0);
fixup_pack_header_footer(fd, sha1, pack_tmp_name, nr_written);
mark_reachable_objects(&revs, 1);
prune_object_dir(get_object_directory());
- sync();
prune_packed_objects(show_only);
remove_temporary_files();
return 0;