@@ -46,11 +46,13 @@ def init(opts={})
46
46
# {:working_directory} otherwise
47
47
#
48
48
# accepts options:
49
- # :remote:: name of remote (rather than 'origin')
50
- # :branch:: name of branch to track (rather than 'master')
51
49
# :bare:: no working directory
52
- # :recursive :: after the clone is created, initialize all submodules within, using their default settings.
50
+ # :branch :: name of branch to track (rather than 'master')
53
51
# :depth:: the number of commits back to pull
52
+ # :origin:: name of remote (same as remote)
53
+ # :path:: directory where the repo will be cloned
54
+ # :remote:: name of remote (rather than 'origin')
55
+ # :recursive:: after the clone is created, initialize all submodules within, using their default settings.
54
56
#
55
57
# TODO - make this work with SSH password or auth_key
56
58
#
@@ -59,14 +61,15 @@ def clone(repository, name, opts = {})
59
61
clone_dir = opts [ :path ] ? File . join ( @path , name ) : name
60
62
61
63
arr_opts = [ ]
62
- arr_opts << "--branch" << opts [ :branch ] if opts [ :branch ]
63
64
arr_opts << "--bare" if opts [ :bare ]
64
- arr_opts << "--recursive" if opts [ :recursive ]
65
- arr_opts << "-o" << opts [ :remote ] if opts [ :remote ]
65
+ arr_opts << "--branch" << opts [ :branch ] if opts [ :branch ]
66
66
arr_opts << "--depth" << opts [ :depth ] . to_i if opts [ :depth ] && opts [ :depth ] . to_i > 0
67
67
arr_opts << "--config" << opts [ :config ] if opts [ :config ]
68
+ arr_opts << "--origin" << opts [ :remote ] || opts [ :origin ] if opts [ :remote ] || opts [ :origin ]
69
+ arr_opts << "--recursive" if opts [ :recursive ]
68
70
69
71
arr_opts << '--'
72
+
70
73
arr_opts << repository
71
74
arr_opts << clone_dir
72
75
0 commit comments