Skip to content

Commit c65eb24

Browse files
committed
Avoid double negatives in the justification for truncation
Turns out, double negatives are harder to parse than positive statements.
1 parent 6571ba7 commit c65eb24

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/indexer.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,8 +1307,11 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
13071307

13081308
#if !defined(NO_MMAP) && defined(GIT_WIN32)
13091309
/*
1310-
* Truncate file to undo rounding up to next page_size in append_to_pack only
1311-
* when mmap was used, to prevent failures in non-Windows remote filesystems.
1310+
* Some non-Windows remote filesystems fail when truncating files if the
1311+
* file permissions change after opening the file (done by p_mkstemp).
1312+
*
1313+
* Truncation is only needed when mmap is used to undo rounding up to next
1314+
* page_size in append_to_pack.
13121315
*/
13131316
if (p_ftruncate(idx->pack->mwf.fd, idx->pack->mwf.size) < 0) {
13141317
git_error_set(GIT_ERROR_OS, "failed to truncate pack file '%s'", idx->pack->pack_name);

0 commit comments

Comments
 (0)