diff options
| -rw-r--r-- | project.py | 25 |
1 files changed, 13 insertions, 12 deletions
| @@ -1853,18 +1853,19 @@ class Project(object): | |||
| 1853 | spec.append('tag') | 1853 | spec.append('tag') |
| 1854 | spec.append(tag_name) | 1854 | spec.append(tag_name) |
| 1855 | 1855 | ||
| 1856 | branch = self.revisionExpr | 1856 | if not self.manifest.IsMirror: |
| 1857 | if is_sha1 and depth: | 1857 | branch = self.revisionExpr |
| 1858 | # Shallow checkout of a specific commit, fetch from that commit and not | 1858 | if is_sha1 and depth: |
| 1859 | # the heads only as the commit might be deeper in the history. | 1859 | # Shallow checkout of a specific commit, fetch from that commit and not |
| 1860 | spec.append(branch) | 1860 | # the heads only as the commit might be deeper in the history. |
| 1861 | else: | 1861 | spec.append(branch) |
| 1862 | if is_sha1: | 1862 | else: |
| 1863 | branch = self.upstream | 1863 | if is_sha1: |
| 1864 | if branch is not None and branch.strip(): | 1864 | branch = self.upstream |
| 1865 | if not branch.startswith('refs/'): | 1865 | if branch is not None and branch.strip(): |
| 1866 | branch = R_HEADS + branch | 1866 | if not branch.startswith('refs/'): |
| 1867 | spec.append(str((u'+%s:' % branch) + remote.ToLocal(branch))) | 1867 | branch = R_HEADS + branch |
| 1868 | spec.append(str((u'+%s:' % branch) + remote.ToLocal(branch))) | ||
| 1868 | cmd.extend(spec) | 1869 | cmd.extend(spec) |
| 1869 | 1870 | ||
| 1870 | shallowfetch = self.config.GetString('repo.shallowfetch') | 1871 | shallowfetch = self.config.GetString('repo.shallowfetch') |
