File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -613,7 +613,11 @@ impl<'cb> Binding for FetchOptions<'cb> {
613613 . map ( |m| m. raw ( ) )
614614 . unwrap_or_else ( || ProxyOptions :: new ( ) . raw ( ) ) ,
615615 prune : crate :: call:: convert ( & self . prune ) ,
616- update_flags : self . update_flags . bits ( ) as c_uint ,
616+ // 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 ,
617621 download_tags : crate :: call:: convert ( & self . download_tags ) ,
618622 depth : self . depth ,
619623 follow_redirects : self . follow_redirects . raw ( ) ,
You can’t perform that action at this time.
0 commit comments