def git_new_branch_from(branch_name, from_branch):
if git_repo_has_branch(branch_name):
- cmd = [GIT, 'branch', '-D', branch_name]
-
- cmdobj = subprocess.Popen(
- cmd,
- shell=False,
- close_fds=True,
- stderr=subprocess.PIPE,
- stdout=subprocess.PIPE,
- env={'':''},
- cwd=os.getcwd()
- )
- cmd = [GIT, 'checkout', branch_name]
+ cmd = [GIT, 'branch', '-D', branch_name]
+
+ cmdobj = subprocess.Popen(
+ cmd,
+ shell=False,
+ close_fds=True,
+ stderr=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ env={'':''},
+ cwd=os.getcwd()
+ )
# this should not happen, we just deleted it
if git_repo_has_branch(branch_name):
# and there is proper error handling below anyway...
#if not git_repo_has_branch(branch_name):
#raise BranchNotExistError(branch_name)
+ cmd = [GIT, 'checkout', branch_name]
cmdobj = subprocess.Popen(