From 01de7f05996db726c9dc402256dff1703eefad05 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 8 Jan 2013 19:49:36 -0800 Subject: [PATCH] Ignore symbolic references during local_prep. In the image update script ignore any branch returned by `git branch -a` containing the ' -> 'substring. This entire string denotes a symbolic reference and is not a valid branch (so it cannot be checked out). We can do this safely because `git branch -a` will also return the branch referred to by the reference. Change-Id: I47852ffd6e25fe3a29a1b310142c5614ca5a6fa9 --- devstack-vm-update-image.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/devstack-vm-update-image.py b/devstack-vm-update-image.py index ed21dde5..84c1434c 100755 --- a/devstack-vm-update-image.py +++ b/devstack-vm-update-image.py @@ -101,6 +101,12 @@ def tokenize(fn, tokens, distribution, comment=None): def local_prep(distribution): branches = [] for branch in git_branches(): + # Ignore branches of the form 'somestring -> someotherstring' as + # this denotes a symbolic reference and the entire string as is + # cannot be checkout out. We can do this safely as the reference + # will refer to one of the other branches returned by git_branches. + if ' -> ' in branch: + continue branch_data = {'name': branch} print 'Branch: ', branch run_local(['git', 'checkout', branch], cwd=DEVSTACK)