summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorZac Livingston <zacl@codeaurora.org>2017-06-13 08:29:04 -0600
committerDavid Pursehouse <dpursehouse@collab.net>2017-08-25 09:10:29 +0900
commit9ead97bb51f5b1ad1d0a45e0c5442f15e1e38fd7 (patch)
tree4edd8cc4d061a3c8971fd6d55a547320120ad10b /git_config.py
parente43322625a423c2dc7aa8b0648c172ccbe7aefa7 (diff)
downloadgit-repo-9ead97bb51f5b1ad1d0a45e0c5442f15e1e38fd7.tar.gz
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
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/git_config.py b/git_config.py
index e00f6be2..8c247394 100644
--- a/git_config.py
+++ b/git_config.py
@@ -50,16 +50,24 @@ else:
50from git_command import GitCommand 50from git_command import GitCommand
51from git_command import ssh_sock 51from git_command import ssh_sock
52from git_command import terminate_ssh_clients 52from git_command import terminate_ssh_clients
53from git_refs import R_CHANGES, R_HEADS, R_TAGS
53 54
54R_HEADS = 'refs/heads/'
55R_TAGS = 'refs/tags/'
56ID_RE = re.compile(r'^[0-9a-f]{40}$') 55ID_RE = re.compile(r'^[0-9a-f]{40}$')
57 56
58REVIEW_CACHE = dict() 57REVIEW_CACHE = dict()
59 58
59def IsChange(rev):
60 return rev.startswith(R_CHANGES)
61
60def IsId(rev): 62def IsId(rev):
61 return ID_RE.match(rev) 63 return ID_RE.match(rev)
62 64
65def IsTag(rev):
66 return rev.startswith(R_TAGS)
67
68def IsImmutable(rev):
69 return IsChange(rev) or IsId(rev) or IsTag(rev)
70
63def _key(name): 71def _key(name):
64 parts = name.split('.') 72 parts = name.split('.')
65 if len(parts) < 2: 73 if len(parts) < 2: