@@ -555,8 +555,7 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
555
555
log_message = StringValueCStr (rb_val );
556
556
557
557
VALUE rb_prune_type = rb_hash_aref (rb_options , CSTR2SYM ("prune" ));
558
- if (!NIL_P (rb_prune_type ))
559
- opts .prune = parse_prune_type (rb_prune_type );
558
+ opts .prune = parse_prune_type (rb_prune_type );
560
559
}
561
560
562
561
error = git_remote_fetch (remote , & refspecs , & opts , log_message );
@@ -641,49 +640,6 @@ static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
641
640
return payload .result ;
642
641
}
643
642
644
- /*
645
- * call-seq:
646
- * remote.prune(options = {}) -> nil
647
- *
648
- * Prune tracking refs that are no longer present on remote
649
- *
650
- * Returns nil
651
- *
652
- * The following options can be passed in the +options+ Hash:
653
- *
654
- * :credentials ::
655
- * The credentials to use for the fetch operation. Can be either an instance of one
656
- * of the Rugged::Credentials types, or a proc returning one of the former.
657
- * The proc will be called with the +url+, the +username+ from the url (if applicable) and
658
- * a list of applicable credential types.
659
- *
660
- * Example:
661
- *
662
- * remote = Rugged::Remote.lookup(@repo, 'origin')
663
- * remote.prune()
664
- *
665
- */
666
- static VALUE rb_git_remote_prune (int argc , VALUE * argv , VALUE self )
667
- {
668
- VALUE rb_options ;
669
- git_remote * remote ;
670
- git_fetch_options opts = GIT_FETCH_OPTIONS_INIT ;
671
- struct rugged_remote_cb_payload payload = { Qnil , Qnil , Qnil , Qnil , Qnil , Qnil , 0 };
672
- int error ;
673
-
674
- Data_Get_Struct (self , git_remote , remote );
675
- rb_scan_args (argc , argv , ":" , & rb_options );
676
- rugged_remote_init_callbacks_and_payload_from_options (rb_options , & opts .callbacks , & payload );
677
-
678
- if ((error = git_remote_connect (remote , GIT_DIRECTION_FETCH , & opts .callbacks )) ||
679
- (error = git_remote_prune (remote , & opts .callbacks )))
680
- git_remote_disconnect (remote );
681
-
682
- rugged_exception_check (error );
683
-
684
- return Qnil ;
685
- }
686
-
687
643
void Init_rugged_remote (void )
688
644
{
689
645
rb_cRuggedRemote = rb_define_class_under (rb_mRugged , "Remote" , rb_cObject );
@@ -698,5 +654,4 @@ void Init_rugged_remote(void)
698
654
rb_define_method (rb_cRuggedRemote , "check_connection" , rb_git_remote_check_connection , -1 );
699
655
rb_define_method (rb_cRuggedRemote , "fetch" , rb_git_remote_fetch , -1 );
700
656
rb_define_method (rb_cRuggedRemote , "push" , rb_git_remote_push , -1 );
701
- rb_define_method (rb_cRuggedRemote , "prune" , rb_git_remote_prune , -1 );
702
657
}
0 commit comments