When starting a branch, do not use a tag or change value for branch.merge
When starting a branch, branch.merge is set to project revision unless
the revision is a SHA1. In that case, branch.merge is set to dest_branch
if defined or manifest default revision otherwise. This special handling
allows repo upload to work when the project revision is a SHA1.
Extend the special handling to also happen when the project revision
is a tag value or a change value so that repo upload will work in those
case as well.
Change-Id: Iff81ece40e770cd02535e80dcb023564d42dcf47
diff --git a/subcmds/start.py b/subcmds/start.py
index 290b689..c3ec303 100644
--- a/subcmds/start.py
+++ b/subcmds/start.py
@@ -18,7 +18,7 @@
import sys
from command import Command
-from git_config import IsId
+from git_config import IsImmutable
from git_command import git
import gitc_utils
from progress import Progress
@@ -96,11 +96,11 @@
project.Sync_LocalHalf(sync_buf)
project.revisionId = gitc_project.old_revision
- # If the current revision is a specific SHA1 then we can't push back
- # to it; so substitute with dest_branch if defined, or with manifest
- # default revision instead.
+ # If the current revision is immutable, such as a SHA1, a tag or
+ # a change, then we can't push back to it. Substitute with
+ # dest_branch, if defined; or with manifest default revision instead.
branch_merge = ''
- if IsId(project.revisionExpr):
+ if IsImmutable(project.revisionExpr):
if project.dest_branch:
branch_merge = project.dest_branch
else: