summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index a44ed5b4..9ae8a4ce 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -79,6 +79,8 @@ _ONE_DAY_S = 24 * 60 * 60
79_REPO_AUTO_GC = "REPO_AUTO_GC" 79_REPO_AUTO_GC = "REPO_AUTO_GC"
80_AUTO_GC = os.environ.get(_REPO_AUTO_GC) == "1" 80_AUTO_GC = os.environ.get(_REPO_AUTO_GC) == "1"
81 81
82_REPO_ALLOW_SHALLOW = os.environ.get("REPO_ALLOW_SHALLOW")
83
82 84
83class _FetchOneResult(NamedTuple): 85class _FetchOneResult(NamedTuple):
84 """_FetchOne return value. 86 """_FetchOne return value.
@@ -638,6 +640,7 @@ later is required to fix a server side protocol bug.
638 ssh_proxy=self.ssh_proxy, 640 ssh_proxy=self.ssh_proxy,
639 clone_filter=project.manifest.CloneFilter, 641 clone_filter=project.manifest.CloneFilter,
640 partial_clone_exclude=project.manifest.PartialCloneExclude, 642 partial_clone_exclude=project.manifest.PartialCloneExclude,
643 clone_filter_for_depth=project.manifest.CloneFilterForDepth,
641 ) 644 )
642 success = sync_result.success 645 success = sync_result.success
643 remote_fetched = sync_result.remote_fetched 646 remote_fetched = sync_result.remote_fetched
@@ -1440,6 +1443,7 @@ later is required to fix a server side protocol bug.
1440 submodules=mp.manifest.HasSubmodules, 1443 submodules=mp.manifest.HasSubmodules,
1441 clone_filter=mp.manifest.CloneFilter, 1444 clone_filter=mp.manifest.CloneFilter,
1442 partial_clone_exclude=mp.manifest.PartialCloneExclude, 1445 partial_clone_exclude=mp.manifest.PartialCloneExclude,
1446 clone_filter_for_depth=mp.manifest.CloneFilterForDepth,
1443 ) 1447 )
1444 finish = time.time() 1448 finish = time.time()
1445 self.event_log.AddSync( 1449 self.event_log.AddSync(
@@ -1589,6 +1593,15 @@ later is required to fix a server side protocol bug.
1589 _PostRepoUpgrade(manifest, quiet=opt.quiet) 1593 _PostRepoUpgrade(manifest, quiet=opt.quiet)
1590 1594
1591 mp = manifest.manifestProject 1595 mp = manifest.manifestProject
1596
1597 if _REPO_ALLOW_SHALLOW is not None:
1598 if _REPO_ALLOW_SHALLOW == "1":
1599 mp.ConfigureCloneFilterForDepth(None)
1600 elif (
1601 _REPO_ALLOW_SHALLOW == "0" and mp.clone_filter_for_depth is None
1602 ):
1603 mp.ConfigureCloneFilterForDepth("blob:none")
1604
1592 if opt.mp_update: 1605 if opt.mp_update:
1593 self._UpdateAllManifestProjects(opt, mp, manifest_name) 1606 self._UpdateAllManifestProjects(opt, mp, manifest_name)
1594 else: 1607 else: