]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
add check
authorRobin Wittler <robin.wittler@profitbricks.com>
Wed, 3 Aug 2011 12:53:42 +0000 (14:53 +0200)
committerRobin Wittler <robin.wittler@profitbricks.com>
Wed, 3 Aug 2011 12:53:42 +0000 (14:53 +0200)
lib/git_helper.py

index 771e6e0032b6024dfc1e5627c68b638b859cee7c..779b57f448ef16fb86a537fffe67fb765be925ad 100644 (file)
@@ -72,6 +72,8 @@ def git_clone_remote_repository(url, destination):
 def git_new_branch_from(branch_name, from_branch):
     if git_repo_has_branch(branch_name):
         raise BranchExistError(branch_name)
+    if not git_repo_has_branch(from_branch):
+        raise BranchNotExistError(from_branch)
     cmd = [GIT, 'checkout', '-b', branch_name, from_branch]
 
     cmdobj = subprocess.Popen(