aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-07-09 11:28:38 +0800
committerRobert Yang <liezhi.yang@windriver.com>2018-07-09 12:06:31 +0800
commit8be7c6c9057c9b1d461aacfde8459adeddb348d5 (patch)
tree6baa7ec2da44eef5a31d7d209aa7785ecb1e9865
parent80d1a821c96364c67d8bd0e48cddb7909adcfd71 (diff)
downloadopenembedded-core-contrib-rbt/li_recs.tar.gz
openembedded-core-contrib-rbt/li_recs.tar.bz2
openembedded-core-contrib-rbt/li_recs.zip
update.py: check whether branch existed when nocheckoutrbt/li_recs
Fixed: Assume there is no master branch in hello layer: $ update.py -l hello -b master INFO: Skipping update of layer hello - branch master doesn't exist This is correct since hello layer doesn't have master branch, but when --nocheckout: $ update.py -l hello -b master --nocheckout [snip] INFO: Sorting layers for branch mater: WARNING: Cannot find required collections on branch master: WARNING: hello: LAYERDEPENDS: <snip> This is incorrect, this patch fixed the problem, now it skips it since the branch doesn't exists when --nocheckout. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rwxr-xr-xlayerindex/update.py4
-rw-r--r--layerindex/update_layer.py3
2 files changed, 3 insertions, 4 deletions
diff --git a/layerindex/update.py b/layerindex/update.py
index 5b5fc43d73..c0a9f88c9f 100755
--- a/layerindex/update.py
+++ b/layerindex/update.py
@@ -345,10 +345,10 @@ def main():
repo = git.Repo(repodir)
assert repo.bare == False
try:
+ # Always get origin/branchname, so it raises error when branch doesn't exist when nocheckout
+ topcommit = repo.commit('origin/%s' % branchname)
if options.nocheckout:
topcommit = repo.commit('HEAD')
- else:
- topcommit = repo.commit('origin/%s' % branchname)
except:
if newbranch:
logger.info("Skipping update of layer %s - branch %s doesn't exist" % (layer.name, branchdesc))
diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py
index 81b730a80a..d941ae646f 100644
--- a/layerindex/update_layer.py
+++ b/layerindex/update_layer.py
@@ -362,10 +362,9 @@ def main():
# Collect repo info
repo = git.Repo(repodir)
assert repo.bare == False
+ topcommit = repo.commit('origin/%s' % branchname)
if options.nocheckout:
topcommit = repo.commit('HEAD')
- else:
- topcommit = repo.commit('origin/%s' % branchname)
tinfoil = None
tempdir = None