From: Mathias Klette Date: Tue, 15 May 2012 11:52:59 +0000 (+0200) Subject: raise an exception when checkout fails X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=c1ad272cc765c98e3eb82ea2795371e81f56ede3;p=profitbricks%2Fjenkins-build-scripts.git raise an exception when checkout fails --- diff --git a/debian_build.py b/debian_build.py index e6e5040..8979b8b 100755 --- a/debian_build.py +++ b/debian_build.py @@ -252,10 +252,10 @@ if __name__ == '__main__': repo = git.repo.Repo() #if GIT_BRANCH_NAME != 'master': - git_helper.git_new_branch_from( - GIT_BRANCH_NAME, - os.path.join('origin', GIT_BRANCH_NAME) - ) + localname = GIT_BRANCH_NAME + remotename = os.path.join('origin', GIT_BRANCH_NAME) + if not git_helper.git_new_branch_from(localname,remotename): + raise Exception('Checkout of %s was not successfull.' %( remotename )) # we need to make sure our jenkins config is used, so let's delete any # other config available in repository that might be prefered