@@ -61,15 +61,15 @@ def clone(repository, name, opts = {})
61
61
arr_opts << "-o" << opts [ :remote ] if opts [ :remote ]
62
62
arr_opts << "--depth" << opts [ :depth ] . to_i if opts [ :depth ] && opts [ :depth ] . to_i > 0
63
63
arr_opts << "--config" << opts [ :config ] if opts [ :config ]
64
- arr_opts << "--mirror" << opts [ :config ] if opts [ :config ]
64
+ arr_opts << "--mirror" if opts [ :mirror ]
65
65
66
66
arr_opts << '--'
67
67
arr_opts << repository
68
68
arr_opts << clone_dir
69
69
70
70
command ( 'clone' , arr_opts )
71
71
72
- opts [ :bare ] ? { :repository => clone_dir } : { :working_directory => clone_dir }
72
+ ( opts [ :bare ] or opts [ :mirror ] ) ? { :repository => clone_dir } : { :working_directory => clone_dir }
73
73
end
74
74
75
75
@@ -227,7 +227,8 @@ def branches_all
227
227
arr = [ ]
228
228
command_lines ( 'branch' , '-a' ) . each do |b |
229
229
current = ( b [ 0 , 2 ] == '* ' )
230
- arr << [ b . gsub ( '* ' , '' ) . strip , current ]
230
+ branch = b . gsub ( '* ' , '' ) . strip
231
+ arr << [ branch , current ] unless branch == '(no branch)'
231
232
end
232
233
arr
233
234
end
@@ -577,6 +578,15 @@ def remote_remove(name)
577
578
command ( 'remote' , [ 'rm' , name ] )
578
579
end
579
580
581
+ def remote_update ( opts = { } )
582
+ remotes = opts . delete ( :remotes )
583
+ arr_opts = [ 'update' ]
584
+ arr_opts << '-p' if opts [ :prune ]
585
+ arr_opts . concat remotes if remotes
586
+
587
+ command ( 'remote' , arr_opts )
588
+ end
589
+
580
590
def remotes
581
591
command_lines ( 'remote' )
582
592
end
0 commit comments