mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-02 16:14:25 +00:00
Merge "project.RemoteFetch: Handle depth cases more robustly"
This commit is contained in:
commit
503d66d8af
13
project.py
13
project.py
@ -1897,7 +1897,7 @@ class Project(object):
|
|||||||
|
|
||||||
if not self.manifest.IsMirror:
|
if not self.manifest.IsMirror:
|
||||||
branch = self.revisionExpr
|
branch = self.revisionExpr
|
||||||
if is_sha1 and depth:
|
if is_sha1 and depth and git_require((1, 8, 3)):
|
||||||
# Shallow checkout of a specific commit, fetch from that commit and not
|
# Shallow checkout of a specific commit, fetch from that commit and not
|
||||||
# the heads only as the commit might be deeper in the history.
|
# the heads only as the commit might be deeper in the history.
|
||||||
spec.append(branch)
|
spec.append(branch)
|
||||||
@ -1960,8 +1960,15 @@ class Project(object):
|
|||||||
# got what we wanted, else trigger a second run of all
|
# got what we wanted, else trigger a second run of all
|
||||||
# refs.
|
# refs.
|
||||||
if not self._CheckForSha1():
|
if not self._CheckForSha1():
|
||||||
return self._RemoteFetch(name=name, current_branch_only=False,
|
if not depth:
|
||||||
initial=False, quiet=quiet, alt_dir=alt_dir)
|
# Avoid infinite recursion when depth is True (since depth implies
|
||||||
|
# current_branch_only)
|
||||||
|
return self._RemoteFetch(name=name, current_branch_only=False,
|
||||||
|
initial=False, quiet=quiet, alt_dir=alt_dir)
|
||||||
|
if self.clone_depth:
|
||||||
|
self.clone_depth = None
|
||||||
|
return self._RemoteFetch(name=name, current_branch_only=current_branch_only,
|
||||||
|
initial=False, quiet=quiet, alt_dir=alt_dir)
|
||||||
|
|
||||||
return ok
|
return ok
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user