diff options
author | LaMont Jones <lamontjones@google.com> | 2022-08-18 07:20:57 -0400 |
---|---|---|
committer | LaMont Jones <lamontjones@google.com> | 2022-10-27 21:59:09 +0000 |
commit | b750b48f50eb4a11087ca6775161d5bf4d5c47d5 (patch) | |
tree | d3d3a7d6d021e1547d9f22875aea57a717540f92 /subcmds/init.py | |
parent | 6c8b894d8d06c8b1bf852b52676ee055a21718d6 (diff) | |
download | git-repo-b750b48f50eb4a11087ca6775161d5bf4d5c47d5.tar.gz |
init: add --manifest-depth for shallow manifest clonev2.29.5
People rarely care about the history of the manifest repo. Add a
parameter to specify depth for the manifest.
For now, make the default behavior the same as the current behavior. At
a future date, the default will be changed to 1. People who need the
full history should begin passing --manifest-depth=0 to preserve the
behavior when the default changes.
We can't reuse the existing --depth option because that applies to
all projects we clone, not just the manifest repo.
Bug: https://crbug.com/gerrit/16193, https://crbug.com/gerrit/16358
Change-Id: I9130fed3eaed656435c778a85cfe9d04e3a4a6a0
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/349814
Tested-by: LaMont Jones <lamontjones@google.com>
Reviewed-by: Xin Li <delphij@google.com>
Diffstat (limited to 'subcmds/init.py')
-rw-r--r-- | subcmds/init.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index cae0e342..0c979cd4 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -109,6 +109,10 @@ to update the working directory files. | |||
109 | Args: | 109 | Args: |
110 | opt: options from optparse. | 110 | opt: options from optparse. |
111 | """ | 111 | """ |
112 | # Normally this value is set when instantiating the project, but the | ||
113 | # manifest project is special and is created when instantiating the | ||
114 | # manifest which happens before we parse options. | ||
115 | self.manifest.manifestProject.clone_depth = opt.manifest_depth | ||
112 | if not self.manifest.manifestProject.Sync( | 116 | if not self.manifest.manifestProject.Sync( |
113 | manifest_url=opt.manifest_url, | 117 | manifest_url=opt.manifest_url, |
114 | manifest_branch=opt.manifest_branch, | 118 | manifest_branch=opt.manifest_branch, |