Skip to content

Commit

Permalink
Merge pull request #58 from gfontenot/gf-submodules
Browse files Browse the repository at this point in the history
Explicitly checkout submodules when needed
  • Loading branch information
segiddins authored Jun 23, 2016
2 parents 0803d22 + 05d9c9e commit a378ad7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@

##### Bug Fixes

* None.
* When downloading git submodules, use an explicit command (`git submodules
--init --recursive`) instead of relying on the `--recursive` behavior for
`git checkout`. This fixes an issue where submodules were checked out using
`--depth=1` under git 2.9.
[Gordon Fontenot](https://github.com/gfontenot)
[#58](https://github.com/CocoaPods/cocoapods-downloader/pull/58)
[CocoaPods#5555](https://github.com/CocoaPods/CocoaPods/issues/5555)


## 1.0.0 (2016-05-10)
Expand Down
8 changes: 6 additions & 2 deletions lib/cocoapods-downloader/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ def clone(force_head = false, shallow_clone = true)
ui_sub_action('Git download') do
begin
git! clone_arguments(force_head, shallow_clone)

if options[:submodules]
Dir.chdir(target_path) do
git! %w(submodule update --init --recursive)
end
end
rescue DownloaderError => e
if e.message =~ /^fatal:.*does not support --depth$/im
clone(force_head, false)
Expand Down Expand Up @@ -114,8 +120,6 @@ def clone_arguments(force_head, shallow_clone)
end
end

command << '--recursive' if options[:submodules]

command
end

Expand Down

0 comments on commit a378ad7

Please sign in to comment.