summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlhchavez <lhchavez@lhchavez.com>2021-09-07 08:38:35 -0700
committerlhchavez <lhchavez@lhchavez.com>2021-09-07 08:38:35 -0700
commiteeceaac06c12b488ca1cb538db067b44664f4db9 (patch)
tree85a65ff5af3cda56dd4c6b6a587c885b960476fb
parent66a75fdee622557346700bae8314ca4af166e0f9 (diff)
downloadlibgit2-eeceaac06c12b488ca1cb538db067b44664f4db9.tar.gz
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~!
-rw-r--r--src/indexer.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/indexer.c b/src/indexer.c
index a5c282a24..d1e354af7 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -1234,12 +1234,6 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
if (git_mwindow_free_all(&idx->pack->mwf) < 0)
goto on_error;
- /* Truncate file to undo rounding up to next page_size in append_to_pack */
- if (p_ftruncate(idx->pack->mwf.fd, idx->pack->mwf.size) < 0) {
- git_error_set(GIT_ERROR_OS, "failed to truncate pack file '%s'", idx->pack->pack_name);
- return -1;
- }
-
if (idx->do_fsync && p_fsync(idx->pack->mwf.fd) < 0) {
git_error_set(GIT_ERROR_OS, "failed to fsync packfile");
goto on_error;