diff options
author | Nasser Grainawi <nasser@codeaurora.org> | 2019-05-21 10:41:35 -0600 |
---|---|---|
committer | Nasser Grainawi <nasser@codeaurora.org> | 2019-05-21 10:47:21 -0600 |
commit | d92464e8efb880ea234b24b7a053b977152e5d0b (patch) | |
tree | d778df2591fccac94717a17b43fb6d7bd8520075 /subcmds | |
parent | 0968570df26f05d26ab566d9effbc8efad06ce80 (diff) | |
download | git-repo-d92464e8efb880ea234b24b7a053b977152e5d0b.tar.gz |
Honor --depth during repo init
If a user is asking for a shallow clone of the repos, they probably
expect a shallow clone of the manifest repo too. For very large
manifest repos, this can be a huge space and time savings. For one real-world
repo, a 'repo init --no-tags --current-branch' used 350MB of disk space and
took 7 minutes. Adding --depth 1 and this change reduced it to 10MB and 2.5
minutes.
Change-Id: I6fa662e174e623ede8861efc862ce26d65d4958d
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/init.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index 9a9e8499..632d1a33 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -197,6 +197,8 @@ to update the working directory files. | |||
197 | else: | 197 | else: |
198 | m.PreSync() | 198 | m.PreSync() |
199 | 199 | ||
200 | self._ConfigureDepth(opt) | ||
201 | |||
200 | if opt.manifest_url: | 202 | if opt.manifest_url: |
201 | r = m.GetRemote(m.remote.name) | 203 | r = m.GetRemote(m.remote.name) |
202 | r.url = opt.manifest_url | 204 | r.url = opt.manifest_url |
@@ -429,6 +431,4 @@ to update the working directory files. | |||
429 | self._ConfigureUser() | 431 | self._ConfigureUser() |
430 | self._ConfigureColor() | 432 | self._ConfigureColor() |
431 | 433 | ||
432 | self._ConfigureDepth(opt) | ||
433 | |||
434 | self._DisplayResult() | 434 | self._DisplayResult() |