File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments