diff options
| -rwxr-xr-x | scripts/combo-layer | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer index 3baea24dee..ae97471d6d 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer | |||
| @@ -283,19 +283,23 @@ def drop_to_shell(workdir=None): | |||
| 283 | 283 | ||
| 284 | def check_rev_branch(component, repodir, rev, branch): | 284 | def check_rev_branch(component, repodir, rev, branch): |
| 285 | try: | 285 | try: |
| 286 | actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False).rstrip() | 286 | actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False) |
| 287 | except subprocess.CalledProcessError as e: | 287 | except subprocess.CalledProcessError as e: |
| 288 | if e.returncode == 129: | 288 | if e.returncode == 129: |
| 289 | actualbranch = "" | 289 | actualbranch = "" |
| 290 | else: | 290 | else: |
| 291 | raise | 291 | raise |
| 292 | 292 | ||
| 293 | if ' ' in actualbranch: | ||
| 294 | actualbranch = actualbranch.split(' ')[-1] | ||
| 295 | if not actualbranch: | 293 | if not actualbranch: |
| 296 | logger.error("%s: specified revision %s is invalid!" % (component, rev)) | 294 | logger.error("%s: specified revision %s is invalid!" % (component, rev)) |
| 297 | return False | 295 | return False |
| 298 | elif actualbranch != branch: | 296 | |
| 297 | branches = [] | ||
| 298 | branchlist = actualbranch.split("\n") | ||
| 299 | for b in branchlist: | ||
| 300 | branches.append(b.strip().split(' ')[-1]) | ||
| 301 | |||
| 302 | if branch not in branches: | ||
| 299 | logger.error("%s: specified revision %s is not on specified branch %s!" % (component, rev, branch)) | 303 | logger.error("%s: specified revision %s is not on specified branch %s!" % (component, rev, branch)) |
| 300 | return False | 304 | return False |
| 301 | return True | 305 | return True |
