From: Holger Levsen Date: Wed, 8 Feb 2012 17:34:51 +0000 (+0100) Subject: lets try to get rid of the double clone X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=f10d76e2aa7c18faabab99169b79a9e9ccc97b69;p=profitbricks%2Fjenkins-build-scripts.git lets try to get rid of the double clone --- diff --git a/lib/git_helper.py b/lib/git_helper.py index f6020b5..228f63a 100644 --- a/lib/git_helper.py +++ b/lib/git_helper.py @@ -118,6 +118,17 @@ def git_checkout_branch(branch_name): #if not git_repo_has_branch(branch_name): #raise BranchNotExistError(branch_name) + cmd = [GIT, 'reset', '--hard'] + + cmdobj = subprocess.Popen( + cmd, + shell=False, + close_fds=True, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, + env={'':''}, + cwd=os.getcwd() + ) cmd = [GIT, 'checkout', branch_name] cmdobj = subprocess.Popen(