diff options
| author | Conley Owens <cco3@android.com> | 2015-07-15 19:29:13 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-07-15 19:29:14 +0000 |
| commit | 503d66d8af1f13660b0982746e44060652a92b65 (patch) | |
| tree | ec85025f1a6003b2aef177dce6d96751820243b3 /project.py | |
| parent | 97836cf09f20e229524aff167c205d89edda3d52 (diff) | |
| parent | 679bac4bf3622412c29e8bca506bc670224d2e31 (diff) | |
| download | git-repo-503d66d8af1f13660b0982746e44060652a92b65.tar.gz | |
Merge "project.RemoteFetch: Handle depth cases more robustly"
Diffstat (limited to 'project.py')
| -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 | ||
