summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2015-07-15 19:29:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-07-15 19:29:14 +0000
commit503d66d8af1f13660b0982746e44060652a92b65 (patch)
treeec85025f1a6003b2aef177dce6d96751820243b3
parent97836cf09f20e229524aff167c205d89edda3d52 (diff)
parent679bac4bf3622412c29e8bca506bc670224d2e31 (diff)
downloadgit-repo-503d66d8af1f13660b0982746e44060652a92b65.tar.gz
Merge "project.RemoteFetch: Handle depth cases more robustly"
-rw-r--r--project.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/project.py b/project.py
index 3f1e3b65..2f70e996 100644
--- a/project.py
+++ b/project.py
@@ -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