File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -722,11 +722,30 @@ def tag(name, *opts)
722
722
command ( 'tag' , arr_opts )
723
723
end
724
724
725
-
725
+ #
726
+ # Fetch from given remote
727
+ #
728
+ # accepts options:
729
+ # :all
730
+ # :t or :tags
731
+ # :p or :prune
732
+ # :refspec
733
+ # :refspecs
734
+ #
735
+ # @param [String|NilClass] remote to fetch from
736
+ # @param [{Symbol=>Object}] opts the given options
737
+ #
726
738
def fetch ( remote , opts )
727
- arr_opts = [ remote ]
739
+ arr_opts = [ ]
740
+ if remote == :all
741
+ arr_opts << '--all'
742
+ else
743
+ arr_opts << remote
744
+ end
728
745
arr_opts << '--tags' if opts [ :t ] || opts [ :tags ]
729
746
arr_opts << '--prune' if opts [ :p ] || opts [ :prune ]
747
+ arr_opts << opts [ :refspec ] if opts [ :refspec ]
748
+ arr_opts << opts [ :refspecs ] . join ( ' ' ) if opts [ :refspecs ]
730
749
731
750
command ( 'fetch' , arr_opts )
732
751
end
You can’t perform that action at this time.
0 commit comments