aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-09-27 11:53:52 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-12-12 16:36:10 +0200
commit841db8edf6b92bdf302b744fbcc62fa9ec5f3701 (patch)
treee52ac73d503564df250014bd993b5a3146a1b6d0
parent7f42aa998e63f434b7879e846ff847c4dea6dc14 (diff)
bootstrap: return to current branch
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xbootstrap.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/bootstrap.py b/bootstrap.py
index 5e42d7d..1a2a324 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -185,6 +185,14 @@ def main(argv=None):
LOG.setLevel(logging.DEBUG)
outdatadir = tempfile.mkdtemp(prefix='gbp_unittest_outdata_')
+
+ # Get current branch / revision
+ try:
+ _cur_ref = git_cmd('symbolic-ref', ['HEAD'], True)[0].strip()
+ orig_rev = _cur_ref.replace('refs/heads/', '')
+ except GitError:
+ orig_rev = git_cmd('rev-parse', ['HEAD'], True)[0].strip()
+
try:
if args.update_branches != 'no':
force = True if args.update_branches == 'force' else False
@@ -197,7 +205,7 @@ def main(argv=None):
if not args.no_build:
for branch in pkgconf['build_branches']:
build_test_pkg(pkg, branch, outdatadir, args.silent_build)
- git_cmd('checkout', ['master'])
+ git_cmd('checkout', [orig_rev])
# Copy all data
test_manifest.write('test-repo-manifest.xml')
@@ -218,7 +226,7 @@ def main(argv=None):
LOG.info('Sparing temporary directory: %s' % outdatadir)
else:
shutil.rmtree(outdatadir)
- git_cmd('checkout', ['master'])
+ git_cmd('checkout', [orig_rev])
if __name__ == '__main__':