mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-23 07:16:21 +00:00
Ignore clone-depth attribute when fetching to a mirror
If a manifest includes projects with a clone-depth=1 attribute, and a workspace is initialised from that manifest using the --mirror option, any workspaces initialised and synced from the mirror will fail with: fatal: attempt to fetch/clone from a shallow repository on the projects that had the clone-depth. Ignore the clone-depth attribute when fetching from the remote to a mirror workspace. Thus the mirror will be synched with a complete clone of all the repositories. Change-Id: I638b77e4894f5eda137d31fa6358eec53cf4654a
This commit is contained in:
parent
e81bc030bb
commit
9bc422f130
@ -1683,11 +1683,17 @@ class Project(object):
|
|||||||
|
|
||||||
is_sha1 = False
|
is_sha1 = False
|
||||||
tag_name = None
|
tag_name = None
|
||||||
|
depth = None
|
||||||
|
|
||||||
|
# The depth should not be used when fetching to a mirror because
|
||||||
|
# it will result in a shallow repository that cannot be cloned or
|
||||||
|
# fetched from.
|
||||||
|
if not self.manifest.IsMirror:
|
||||||
if self.clone_depth:
|
if self.clone_depth:
|
||||||
depth = self.clone_depth
|
depth = self.clone_depth
|
||||||
else:
|
else:
|
||||||
depth = self.manifest.manifestProject.config.GetString('repo.depth')
|
depth = self.manifest.manifestProject.config.GetString('repo.depth')
|
||||||
|
|
||||||
if depth:
|
if depth:
|
||||||
current_branch_only = True
|
current_branch_only = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user