-
-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: assure memory maps don't get in the way of updating `.git/packet…
…-refs` on Windows. (#1183) The solution entails to not use memory maps on Windows which is certainly fine on todays systems, even though it's likely to add latency.
- Loading branch information
Showing
5 changed files
with
250 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use crate::file::store; | ||
|
||
#[test] | ||
fn set_packed_buffer_mmap_threshold() -> crate::Result { | ||
let mut store = store()?; | ||
let prev = store.set_packed_buffer_mmap_threshold(0); | ||
if cfg!(windows) { | ||
assert_eq!( | ||
prev, | ||
u64::MAX, | ||
"on windows mmap are deactivated as otherwise we can't change packed-refs while it's mapped" | ||
); | ||
} else { | ||
assert_eq!(prev, 32 * 1024, "the default is the value that Git uses as well"); | ||
} | ||
assert_eq!( | ||
store.set_packed_buffer_mmap_threshold(0), | ||
0, | ||
"it actually sets the value" | ||
); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod access; | ||
mod find; | ||
mod iter; | ||
mod reflog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.