@@ -3,6 +3,7 @@ use std::iter::FusedIterator;
3
3
use std:: marker;
4
4
use std:: mem;
5
5
use std:: ops:: Range ;
6
+ use std:: os:: raw:: c_uint;
6
7
use std:: ptr;
7
8
use std:: slice;
8
9
use std:: str;
@@ -11,7 +12,7 @@ use std::{ffi::CString, os::raw::c_char};
11
12
use crate :: string_array:: StringArray ;
12
13
use crate :: util:: Binding ;
13
14
use 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 } ;
15
16
16
17
/// A structure representing a [remote][1] of a git repository.
17
18
///
@@ -320,7 +321,7 @@ impl<'repo> Remote<'repo> {
320
321
pub fn update_tips (
321
322
& mut self ,
322
323
callbacks : Option < & mut RemoteCallbacks < ' _ > > ,
323
- update_fetchhead : bool ,
324
+ update_flags : RemoteUpdateFlags ,
324
325
download_tags : AutotagOption ,
325
326
msg : Option < & str > ,
326
327
) -> Result < ( ) , Error > {
@@ -330,7 +331,7 @@ impl<'repo> Remote<'repo> {
330
331
try_call ! ( raw:: git_remote_update_tips(
331
332
self . raw,
332
333
cbs. as_ref( ) ,
333
- update_fetchhead ,
334
+ update_flags . bits ( ) as c_uint ,
334
335
download_tags,
335
336
msg
336
337
) ) ;
@@ -778,7 +779,7 @@ impl RemoteRedirect {
778
779
779
780
#[ cfg( test) ]
780
781
mod tests {
781
- use crate :: { AutotagOption , PushOptions } ;
782
+ use crate :: { AutotagOption , PushOptions , RemoteUpdateFlags } ;
782
783
use crate :: { Direction , FetchOptions , Remote , RemoteCallbacks , Repository } ;
783
784
use std:: cell:: Cell ;
784
785
use tempfile:: TempDir ;
@@ -867,10 +868,20 @@ mod tests {
867
868
origin. fetch ( & [ ] as & [ & str ] , None , None ) . unwrap ( ) ;
868
869
origin. fetch ( & [ ] as & [ & str ] , None , Some ( "foo" ) ) . unwrap ( ) ;
869
870
origin
870
- . update_tips ( None , true , AutotagOption :: Unspecified , None )
871
+ . update_tips (
872
+ None ,
873
+ RemoteUpdateFlags :: UPDATE_FETCHHEAD ,
874
+ AutotagOption :: Unspecified ,
875
+ None ,
876
+ )
871
877
. unwrap ( ) ;
872
878
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
+ )
874
885
. unwrap ( ) ;
875
886
876
887
t ! ( repo. remote_add_fetch( "origin" , "foo" ) ) ;
0 commit comments