From 35399215739da2ec66881cc331de8ea22fb66f77 Mon Sep 17 00:00:00 2001 From: Graham Hayes Date: Fri, 16 Feb 2018 14:12:18 +0000 Subject: [PATCH] gerrit tests should return to checked out branch when running "tox -e gerrit" on a local checkout after the tests have finshed the repo is checked out to the HEAD commit, not the branch that was checked out before the run. This ensures the branch is checked out at the end of the test. Change-Id: I58dae937000d05c3a9b09dc4aed5362a5c56d133 --- tools/check_gerrit_projects_changed.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/check_gerrit_projects_changed.sh b/tools/check_gerrit_projects_changed.sh index 94f5853c27..55bd5610e8 100755 --- a/tools/check_gerrit_projects_changed.sh +++ b/tools/check_gerrit_projects_changed.sh @@ -2,6 +2,7 @@ GITHEAD=$(git rev-parse HEAD) +GITBRANCH=$(git rev-parse --abbrev-ref HEAD) # Check out previous version git checkout HEAD~1 @@ -16,3 +17,4 @@ python tools/check_gerrit_projects_changed.py gerrit/projects-old.yaml \ gerrit/projects.yaml rm gerrit/projects-old.yaml +git checkout $GITBRANCH