diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2014-04-15 10:28:56 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2014-04-16 11:00:40 +0900 |
commit | 9bc422f1301a54aaabc6ac279989970c4b6f5137 (patch) | |
tree | 1f7eea668663481daef0e6f3a30aa4d191da2c8e | |
parent | e81bc030bba802627fd34af472fc0cf451e17c1d (diff) | |
download | git-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.py | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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 | ||