Skip to content

Commit c945685

Browse files
committed
better management of switches on git clone
1 parent c1910e5 commit c945685

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/git/lib.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ def clone(repository, name, opts = {})
5050
arr_opts << "-o" << opts[:remote] if opts[:remote]
5151
arr_opts << "--depth" << opts[:depth].to_i if opts[:depth] && opts[:depth].to_i > 0
5252

53+
# -- allow processing of switches added as array elements
54+
Array(opts[:switches]).each { |switch| arr_opts << switch }
5355
#
54-
arr_opts << opts[:switches].join(' ') unless opts[:switches].nil?
5556

5657
arr_opts << '--'
5758
arr_opts << repository

0 commit comments

Comments
 (0)