mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 12:49:01 +02:00
update.py: check whether branch existed when nocheckout
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> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
f5e2751034
commit
7728c0f84f
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user