summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2014-04-15 10:28:56 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2014-04-16 11:00:40 +0900
commit9bc422f1301a54aaabc6ac279989970c4b6f5137 (patch)
tree1f7eea668663481daef0e6f3a30aa4d191da2c8e
parente81bc030bba802627fd34af472fc0cf451e17c1d (diff)
downloadgit-repo-9bc422f1301a54aaabc6ac279989970c4b6f5137.tar.gz
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
-rw-r--r--project.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/project.py b/project.py
index 48fa82b7..876b86ac 100644
--- a/project.py
+++ b/project.py
@@ -1683,11 +1683,17 @@ class Project(object):
1683 1683
1684 is_sha1 = False 1684 is_sha1 = False
1685 tag_name = None 1685 tag_name = None
1686 depth = None
1687
1688 # The depth should not be used when fetching to a mirror because
1689 # it will result in a shallow repository that cannot be cloned or
1690 # fetched from.
1691 if not self.manifest.IsMirror:
1692 if self.clone_depth:
1693 depth = self.clone_depth
1694 else:
1695 depth = self.manifest.manifestProject.config.GetString('repo.depth')
1686 1696
1687 if self.clone_depth:
1688 depth = self.clone_depth
1689 else:
1690 depth = self.manifest.manifestProject.config.GetString('repo.depth')
1691 if depth: 1697 if depth:
1692 current_branch_only = True 1698 current_branch_only = True
1693 1699