Skip to content

Commit 7279897

Browse files
committed
Add --recursive option to clone command
1 parent b79de3a commit 7279897

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/git/lib.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ def init
3535
# {:working_directory} otherwise
3636
#
3737
# accepts options:
38-
# :remote:: name of remote (rather than 'origin')
39-
# :bare:: no working directory
40-
# :depth:: the number of commits back to pull
38+
# :remote:: name of remote (rather than 'origin')
39+
# :bare:: no working directory
40+
# :recursive:: after the clone is created, initialize all submodules within, using their default settings.
41+
# :depth:: the number of commits back to pull
4142
#
4243
# TODO - make this work with SSH password or auth_key
4344
#
@@ -47,8 +48,9 @@ def clone(repository, name, opts = {})
4748

4849
arr_opts = []
4950
arr_opts << "--bare" if opts[:bare]
51+
arr_opts << "--recursive" if opts[:recursive]
5052
arr_opts << "-o" << opts[:remote] if opts[:remote]
51-
arr_opts << "--depth" << opts[:depth].to_i if opts[:depth] && opts[:depth].to_i > 0
53+
arr_opts << "--depth" << opts[:depth].to_i if opts[:depth] && opts[:depth].to_i > 0
5254

5355
arr_opts << '--'
5456
arr_opts << repository

0 commit comments

Comments
 (0)