Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for git clone '--no-single-branch' option. #323

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 9 additions & 7 deletions lib/git/lib.rb
Expand Up @@ -46,13 +46,14 @@ def init(opts={})
# {:working_directory} otherwise
#
# accepts options:
# :bare:: no working directory
# :branch:: name of branch to track (rather than 'master')
# :depth:: the number of commits back to pull
# :origin:: name of remote (same as remote)
# :path:: directory where the repo will be cloned
# :remote:: name of remote (rather than 'origin')
# :recursive:: after the clone is created, initialize all submodules within, using their default settings.
# :bare:: no working directory
# :branch:: name of branch to track (rather than 'master')
# :depth:: the number of commits back to pull
# :origin:: name of remote (same as remote)
# :path:: directory where the repo will be cloned
# :remote:: name of remote (rather than 'origin')
# :recursive:: after the clone is created, initialize all submodules within, using their default settings.
# :no_single_branch:: fetch the history near the tips of all branches when used with :depth
#
# TODO - make this work with SSH password or auth_key
#
Expand All @@ -67,6 +68,7 @@ def clone(repository, name, opts = {})
arr_opts << '--config' << opts[:config] if opts[:config]
arr_opts << '--origin' << opts[:remote] || opts[:origin] if opts[:remote] || opts[:origin]
arr_opts << '--recursive' if opts[:recursive]
arr_opts << '--no-single-branch' if opts[:no_single_branch]

arr_opts << '--'

Expand Down