summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'project.py')
-rw-r--r--project.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/project.py b/project.py
index 95403ccb..e501cc26 100644
--- a/project.py
+++ b/project.py
@@ -1730,10 +1730,11 @@ class Project(object):
1730 if depth: 1730 if depth:
1731 current_branch_only = True 1731 current_branch_only = True
1732 1732
1733 if ID_RE.match(self.revisionExpr) is not None:
1734 is_sha1 = True
1735
1733 if current_branch_only: 1736 if current_branch_only:
1734 if ID_RE.match(self.revisionExpr) is not None: 1737 if self.revisionExpr.startswith(R_TAGS):
1735 is_sha1 = True
1736 elif self.revisionExpr.startswith(R_TAGS):
1737 # this is a tag and its sha1 value should never change 1738 # this is a tag and its sha1 value should never change
1738 tag_name = self.revisionExpr[len(R_TAGS):] 1739 tag_name = self.revisionExpr[len(R_TAGS):]
1739 1740
@@ -1820,9 +1821,10 @@ class Project(object):
1820 branch = self.revisionExpr 1821 branch = self.revisionExpr
1821 if is_sha1: 1822 if is_sha1:
1822 branch = self.upstream 1823 branch = self.upstream
1823 if branch.startswith(R_HEADS): 1824 if branch is not None and branch.strip():
1824 branch = branch[len(R_HEADS):] 1825 if not branch.startswith('refs/'):
1825 spec.append(str((u'+refs/heads/%s:' % branch) + remote.ToLocal('refs/heads/%s' % branch))) 1826 branch = R_HEADS + branch
1827 spec.append(str((u'+%s:' % branch) + remote.ToLocal(branch)))
1826 cmd.extend(spec) 1828 cmd.extend(spec)
1827 1829
1828 shallowfetch = self.config.GetString('repo.shallowfetch') 1830 shallowfetch = self.config.GetString('repo.shallowfetch')