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

Add "recursive" attribute to git resource #140

Merged
merged 3 commits into from
Jul 6, 2015

Conversation

mmasaki
Copy link
Contributor

@mmasaki mmasaki commented Jun 30, 2015

I propose an new attribute "recursive" into git resource.

Example:

git "foo" do
  repository "https://github.com/foo/including_submodules.git"
  recursive true
end

Then, "git clone --recursive https://github.com/foo/including_submodules.git" will be executed.

@ryotarai
Copy link
Member

Great but I think the code is a little duplicated. How about the following?

cmd = ['git', 'clone']
cmd << '--recursive' if attributes.recursive
cmd << attributes.repository << attributes.destination
run_command(cmd)

@mmasaki
Copy link
Contributor Author

mmasaki commented Jul 6, 2015

Tests were failed, but I think it's not this change's sake.
Please consider re-testing and merging this change.

@@ -29,7 +30,15 @@ def action_sync(options)
if run_specinfra(:check_file_is_directory, attributes.destination)
run_command_in_repo(['git', 'fetch', 'origin'])
else
run_command(['git', 'clone', attributes.repository, attributes.destination])
if attributes.recursive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L33-37: Please remove these lines

@mmasaki
Copy link
Contributor Author

mmasaki commented Jul 6, 2015

That's my mistake...

@ryotarai
Copy link
Member

ryotarai commented Jul 6, 2015

Thank you for your contribution!

ryotarai added a commit that referenced this pull request Jul 6, 2015
Add "recursive" attribute to git resource
@ryotarai ryotarai merged commit c61b48a into itamae-kitchen:master Jul 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants