GitDownloadStrategy: support submodule changes

This commits adds support for updating a formula with changed git
submodules with GitDownloadStrategy when the cloned repository is still
in the cache. This is done by running git submodule sync --recursive
before updating the submodules, so that git can reload the submodule
config from the updated .gitmodules file.

Fixes Homebrew/homebrew#36395.
Closes Homebrew/homebrew#36466.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Christian Moritz 2015-02-02 18:08:02 +01:00 committed by Jack Nagel
parent f2a9b9cbd2
commit 79bde9c13b

View File

@ -646,6 +646,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
end
def update_submodules
quiet_safe_system "git", "submodule", "sync", "--recursive"
quiet_safe_system "git", "submodule", "update", "--init", "--recursive"
end