@@ -3,6 +3,7 @@ use std::iter::FusedIterator;
33use std:: marker;
44use std:: mem;
55use std:: ops:: Range ;
6+ use std:: os:: raw:: c_uint;
67use std:: ptr;
78use std:: slice;
89use std:: str;
@@ -11,7 +12,7 @@ use std::{ffi::CString, os::raw::c_char};
1112use crate :: string_array:: StringArray ;
1213use crate :: util:: Binding ;
1314use crate :: { call, raw, Buf , Direction , Error , FetchPrune , Oid , ProxyOptions , Refspec } ;
14- use crate :: { AutotagOption , Progress , RemoteCallbacks , Repository } ;
15+ use crate :: { AutotagOption , Progress , RemoteCallbacks , RemoteUpdateFlags , Repository } ;
1516
1617/// A structure representing a [remote][1] of a git repository.
1718///
@@ -320,7 +321,7 @@ impl<'repo> Remote<'repo> {
320321 pub fn update_tips (
321322 & mut self ,
322323 callbacks : Option < & mut RemoteCallbacks < ' _ > > ,
323- update_fetchhead : bool ,
324+ update_flags : RemoteUpdateFlags ,
324325 download_tags : AutotagOption ,
325326 msg : Option < & str > ,
326327 ) -> Result < ( ) , Error > {
@@ -330,7 +331,7 @@ impl<'repo> Remote<'repo> {
330331 try_call ! ( raw:: git_remote_update_tips(
331332 self . raw,
332333 cbs. as_ref( ) ,
333- update_fetchhead ,
334+ update_flags . bits ( ) as c_uint ,
334335 download_tags,
335336 msg
336337 ) ) ;
@@ -778,7 +779,7 @@ impl RemoteRedirect {
778779
779780#[ cfg( test) ]
780781mod tests {
781- use crate :: { AutotagOption , PushOptions } ;
782+ use crate :: { AutotagOption , PushOptions , RemoteUpdateFlags } ;
782783 use crate :: { Direction , FetchOptions , Remote , RemoteCallbacks , Repository } ;
783784 use std:: cell:: Cell ;
784785 use tempfile:: TempDir ;
@@ -867,10 +868,20 @@ mod tests {
867868 origin. fetch ( & [ ] as & [ & str ] , None , None ) . unwrap ( ) ;
868869 origin. fetch ( & [ ] as & [ & str ] , None , Some ( "foo" ) ) . unwrap ( ) ;
869870 origin
870- . update_tips ( None , true , AutotagOption :: Unspecified , None )
871+ . update_tips (
872+ None ,
873+ RemoteUpdateFlags :: UPDATE_FETCHHEAD ,
874+ AutotagOption :: Unspecified ,
875+ None ,
876+ )
871877 . unwrap ( ) ;
872878 origin
873- . update_tips ( None , true , AutotagOption :: All , Some ( "foo" ) )
879+ . update_tips (
880+ None ,
881+ RemoteUpdateFlags :: UPDATE_FETCHHEAD ,
882+ AutotagOption :: All ,
883+ Some ( "foo" ) ,
884+ )
874885 . unwrap ( ) ;
875886
876887 t ! ( repo. remote_add_fetch( "origin" , "foo" ) ) ;
0 commit comments