From 6a2e4710bf3bbde9ab3f8c5ce44f7e9cd1fb3036 Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Tue, 19 Mar 2013 15:54:33 +0000 Subject: [PATCH] Make gclient fetch git repos recursively. This is needed when adding a git repo through DEPS. If that repo has submodules, we need to fetch them or else the repo won't be complete. Review URL: https://chromiumcodereview.appspot.com/12620024 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@189026 0039d316-1c4b-4281-b951-d872f2087c98 --- gclient_scm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gclient_scm.py b/gclient_scm.py index 408db6a1b6..529b7ffd66 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -202,6 +202,7 @@ class GitWrapper(SCMWrapper): cmd = ['git', 'submodule', '--quiet', 'foreach', ' '.join(submod_cmd)] cmd2 = ['git', 'config', 'diff.ignoreSubmodules', 'all'] cmd3 = ['git', 'config', 'branch.autosetupmerge'] + cmd4 = ['git', 'config', 'fetch.recurseSubmodules', 'true'] kwargs = {'cwd': self.checkout_path, 'print_stdout': False, 'filter_fn': lambda x: None} @@ -217,6 +218,8 @@ class GitWrapper(SCMWrapper): except subprocess2.CalledProcessError: gclient_utils.CheckCallAndFilter(cmd3 + ['always'], **kwargs) + gclient_utils.CheckCallAndFilter(cmd4, **kwargs) + def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy. @@ -656,6 +659,7 @@ class GitWrapper(SCMWrapper): if options.verbose: clone_cmd.append('--verbose') clone_cmd.extend([url, self.checkout_path]) + clone_cmd.append('--recursive') # If the parent directory does not exist, Git clone on Windows will not # create it, so we need to do it manually.