Skip to content

Commit eeceaac

Browse files
committed
Also remove a ftruncate(2) call in git_indexer_commit
Now that we're not using `mmap(2)` for writing stuff, we don't need to truncate the file afterwards, since it'll have the correct size at the end of the process. Whee~!
1 parent 66a75fd commit eeceaac

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/indexer.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,12 +1234,6 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
12341234
if (git_mwindow_free_all(&idx->pack->mwf) < 0)
12351235
goto on_error;
12361236

1237-
/* Truncate file to undo rounding up to next page_size in append_to_pack */
1238-
if (p_ftruncate(idx->pack->mwf.fd, idx->pack->mwf.size) < 0) {
1239-
git_error_set(GIT_ERROR_OS, "failed to truncate pack file '%s'", idx->pack->pack_name);
1240-
return -1;
1241-
}
1242-
12431237
if (idx->do_fsync && p_fsync(idx->pack->mwf.fd) < 0) {
12441238
git_error_set(GIT_ERROR_OS, "failed to fsync packfile");
12451239
goto on_error;

0 commit comments

Comments
 (0)