From b20f71adfeba4f2705b9a46a4bc08fb65f3d6ad8 Mon Sep 17 00:00:00 2001
From: Thierry Carrez <thierry@openstack.org>
Date: Fri, 4 Apr 2014 15:39:57 +0200
Subject: [PATCH] Fix milestone-proposed requirements update

milestone-proposed was checked out in a detached state, which prevents
git-review from successfully proposing changes to it. It works with
master because master is checked out by default on the initial clone.

This commit makes sure the branch is checked out with proper origin
tracking before proceeding with changes.

Fixes bug #1302490

Change-Id: Iff4f653d2d68fd36bb076ed8ae9fa5b0bb03edda
---
 .../jenkins/files/slave_scripts/propose_requirements_update.sh  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/jenkins/files/slave_scripts/propose_requirements_update.sh b/modules/jenkins/files/slave_scripts/propose_requirements_update.sh
index 339a449dd3..c7486eb0c4 100755
--- a/modules/jenkins/files/slave_scripts/propose_requirements_update.sh
+++ b/modules/jenkins/files/slave_scripts/propose_requirements_update.sh
@@ -61,7 +61,7 @@ EOF
 
     # make sure the project even has this branch
     if git branch -a | grep -q "^  remotes/origin/$BRANCH$" ; then
-        git checkout origin/${BRANCH}
+        git checkout -B ${BRANCH} -t origin/${BRANCH}
         git review -s
         popd