Method: Rugged::SubmoduleCollection#add
- Defined in:
- lib/rugged/submodule_collection.rb
#add(url, path, options = {}) ⇒ Object
call-seq:
submodules.setup_add(url, path[, options]) -> submodule
Add a new submodule.
This does "git submodule add" incuding fetch and checkout of the submodule contents.
-
url: URL for the submodule’s remote -
path: path at which the submodule should be created
The options hash accepts all options supported by Rugged::Remote#fetch and the following:
- :gitlink
-
(defaults to
true) should workdir contain a gitlink to the repository in.git/modulesvs. repository directly in workdir.
Returns the newly created submodule
28 29 30 31 32 |
# File 'lib/rugged/submodule_collection.rb', line 28 def add(url, path, = {}) submodule = setup_add(url, path, **) clone_submodule(submodule.repository, **) submodule.finalize_add end |