diff options
-rwxr-xr-x | layerindex/update.py | 4 | ||||
-rw-r--r-- | layerindex/update_layer.py | 3 |
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 |