diff options
author | lhchavez <lhchavez@lhchavez.com> | 2021-09-08 08:47:39 -0700 |
---|---|---|
committer | lhchavez <lhchavez@lhchavez.com> | 2021-09-08 08:47:39 -0700 |
commit | c65eb24c546a37c8225a1e8b00bd3ab81818243f (patch) | |
tree | 77535167cc90336262b21d37647e0b4b3be93225 | |
parent | 6571ba7b3585a390b6de164aaa5eb93036ef295c (diff) | |
download | libgit2-c65eb24c546a37c8225a1e8b00bd3ab81818243f.tar.gz |
Avoid double negatives in the justification for truncation
Turns out, double negatives are harder to parse than positive
statements.
-rw-r--r-- | src/indexer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/indexer.c b/src/indexer.c index d5e328880..ce7737500 100644 --- a/src/indexer.c +++ b/src/indexer.c @@ -1307,8 +1307,11 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats) #if !defined(NO_MMAP) && defined(GIT_WIN32) /* - * Truncate file to undo rounding up to next page_size in append_to_pack only - * when mmap was used, to prevent failures in non-Windows remote filesystems. + * Some non-Windows remote filesystems fail when truncating files if the + * file permissions change after opening the file (done by p_mkstemp). + * + * Truncation is only needed when mmap is used 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); |