We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
update_flags
1 parent bb75668 commit 3c105a7Copy full SHA for 3c105a7
src/remote.rs
@@ -613,7 +613,11 @@ impl<'cb> Binding for FetchOptions<'cb> {
613
.map(|m| m.raw())
614
.unwrap_or_else(|| ProxyOptions::new().raw()),
615
prune: crate::call::convert(&self.prune),
616
- update_flags: self.update_flags.bits() as c_uint,
+ // HACK: `libgit2` uses C bitfields, which do not have a guaranteed memory layout.
617
+ // Reversing the bits ensures that the bitfields are set whether the bits are laid out
618
+ // from left to right or right to left, but will not work on other memory layouts.
619
+ update_flags: (self.update_flags.bits() | self.update_flags.bits().reverse_bits())
620
+ as c_uint,
621
download_tags: crate::call::convert(&self.download_tags),
622
depth: self.depth,
623
follow_redirects: self.follow_redirects.raw(),
0 commit comments