diff options
Diffstat (limited to 'subcmds/init.py')
| -rw-r--r-- | subcmds/init.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index 9946466d..6d7fd857 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
| @@ -20,6 +20,8 @@ from command import InteractiveCommand, MirrorSafeCommand | |||
| 20 | from git_command import git_require, MIN_GIT_VERSION_SOFT, MIN_GIT_VERSION_HARD | 20 | from git_command import git_require, MIN_GIT_VERSION_SOFT, MIN_GIT_VERSION_HARD |
| 21 | from wrapper import Wrapper | 21 | from wrapper import Wrapper |
| 22 | 22 | ||
| 23 | _REPO_ALLOW_SHALLOW = os.environ.get("REPO_ALLOW_SHALLOW") | ||
| 24 | |||
| 23 | 25 | ||
| 24 | class Init(InteractiveCommand, MirrorSafeCommand): | 26 | class Init(InteractiveCommand, MirrorSafeCommand): |
| 25 | COMMON = True | 27 | COMMON = True |
| @@ -125,6 +127,9 @@ to update the working directory files. | |||
| 125 | # manifest project is special and is created when instantiating the | 127 | # manifest project is special and is created when instantiating the |
| 126 | # manifest which happens before we parse options. | 128 | # manifest which happens before we parse options. |
| 127 | self.manifest.manifestProject.clone_depth = opt.manifest_depth | 129 | self.manifest.manifestProject.clone_depth = opt.manifest_depth |
| 130 | clone_filter_for_depth = ( | ||
| 131 | "blob:none" if (_REPO_ALLOW_SHALLOW == "0") else None | ||
| 132 | ) | ||
| 128 | if not self.manifest.manifestProject.Sync( | 133 | if not self.manifest.manifestProject.Sync( |
| 129 | manifest_url=opt.manifest_url, | 134 | manifest_url=opt.manifest_url, |
| 130 | manifest_branch=opt.manifest_branch, | 135 | manifest_branch=opt.manifest_branch, |
| @@ -140,6 +145,7 @@ to update the working directory files. | |||
| 140 | partial_clone=opt.partial_clone, | 145 | partial_clone=opt.partial_clone, |
| 141 | clone_filter=opt.clone_filter, | 146 | clone_filter=opt.clone_filter, |
| 142 | partial_clone_exclude=opt.partial_clone_exclude, | 147 | partial_clone_exclude=opt.partial_clone_exclude, |
| 148 | clone_filter_for_depth=clone_filter_for_depth, | ||
| 143 | clone_bundle=opt.clone_bundle, | 149 | clone_bundle=opt.clone_bundle, |
| 144 | git_lfs=opt.git_lfs, | 150 | git_lfs=opt.git_lfs, |
| 145 | use_superproject=opt.use_superproject, | 151 | use_superproject=opt.use_superproject, |
