diff options
| -rw-r--r-- | project.py | 13 |
1 files changed, 10 insertions, 3 deletions
| @@ -1897,7 +1897,7 @@ class Project(object): | |||
| 1897 | 1897 | ||
| 1898 | if not self.manifest.IsMirror: | 1898 | if not self.manifest.IsMirror: |
| 1899 | branch = self.revisionExpr | 1899 | branch = self.revisionExpr |
| 1900 | if is_sha1 and depth: | 1900 | if is_sha1 and depth and git_require((1, 8, 3)): |
| 1901 | # Shallow checkout of a specific commit, fetch from that commit and not | 1901 | # Shallow checkout of a specific commit, fetch from that commit and not |
| 1902 | # the heads only as the commit might be deeper in the history. | 1902 | # the heads only as the commit might be deeper in the history. |
| 1903 | spec.append(branch) | 1903 | spec.append(branch) |
| @@ -1960,8 +1960,15 @@ class Project(object): | |||
| 1960 | # got what we wanted, else trigger a second run of all | 1960 | # got what we wanted, else trigger a second run of all |
| 1961 | # refs. | 1961 | # refs. |
| 1962 | if not self._CheckForSha1(): | 1962 | if not self._CheckForSha1(): |
| 1963 | return self._RemoteFetch(name=name, current_branch_only=False, | 1963 | if not depth: |
| 1964 | initial=False, quiet=quiet, alt_dir=alt_dir) | 1964 | # Avoid infinite recursion when depth is True (since depth implies |
| 1965 | # current_branch_only) | ||
| 1966 | return self._RemoteFetch(name=name, current_branch_only=False, | ||
| 1967 | initial=False, quiet=quiet, alt_dir=alt_dir) | ||
| 1968 | if self.clone_depth: | ||
| 1969 | self.clone_depth = None | ||
| 1970 | return self._RemoteFetch(name=name, current_branch_only=current_branch_only, | ||
| 1971 | initial=False, quiet=quiet, alt_dir=alt_dir) | ||
| 1965 | 1972 | ||
| 1966 | return ok | 1973 | return ok |
| 1967 | 1974 | ||
