def merge_branch(repo, branch):
 try:
  check_call(['git', 'pull', repo, branch], stdin=io.open(os.devnull))
 except CalledProcessError:
  check_call(['git', 'merge', '--abort'])
  return False
 return True

def merge_branch ( repo , branch ) : try : check_call ( [ 'git' , 'pull' , repo , branch ] , stdin = io . open ( os . devnull ) ) except CalledProcessError : check_call ( [ 'git' , 'merge' , '--abort' ] ) return False return True
try to merge the givent branch into the current one if something does not goes smoothly .