|
@@ -1730,10 +1730,11 @@ class Project(object):
|
|
|
if depth:
|
|
if depth:
|
|
|
current_branch_only = True
|
|
current_branch_only = True
|
|
|
|
|
|
|
|
|
|
+ if ID_RE.match(self.revisionExpr) is not None:
|
|
|
|
|
+ is_sha1 = True
|
|
|
|
|
+
|
|
|
if current_branch_only:
|
|
if current_branch_only:
|
|
|
- if ID_RE.match(self.revisionExpr) is not None:
|
|
|
|
|
- is_sha1 = True
|
|
|
|
|
- elif self.revisionExpr.startswith(R_TAGS):
|
|
|
|
|
|
|
+ if self.revisionExpr.startswith(R_TAGS):
|
|
|
# this is a tag and its sha1 value should never change
|
|
# this is a tag and its sha1 value should never change
|
|
|
tag_name = self.revisionExpr[len(R_TAGS):]
|
|
tag_name = self.revisionExpr[len(R_TAGS):]
|
|
|
|
|
|
|
@@ -1820,9 +1821,10 @@ class Project(object):
|
|
|
branch = self.revisionExpr
|
|
branch = self.revisionExpr
|
|
|
if is_sha1:
|
|
if is_sha1:
|
|
|
branch = self.upstream
|
|
branch = self.upstream
|
|
|
- if branch.startswith(R_HEADS):
|
|
|
|
|
- branch = branch[len(R_HEADS):]
|
|
|
|
|
- spec.append(str((u'+refs/heads/%s:' % branch) + remote.ToLocal('refs/heads/%s' % branch)))
|
|
|
|
|
|
|
+ if branch is not None and branch.strip():
|
|
|
|
|
+ if not branch.startswith('refs/'):
|
|
|
|
|
+ branch = R_HEADS + branch
|
|
|
|
|
+ spec.append(str((u'+%s:' % branch) + remote.ToLocal(branch)))
|
|
|
cmd.extend(spec)
|
|
cmd.extend(spec)
|
|
|
|
|
|
|
|
shallowfetch = self.config.GetString('repo.shallowfetch')
|
|
shallowfetch = self.config.GetString('repo.shallowfetch')
|