def get_local_branch():
 if is_git_repo():
  (o, _) = Popen(u'git branch | grep "\\* "', shell=True, stdout=PIPE, cwd=os.path.dirname(nipype.__file__)).communicate()
  return o.strip()[2:]
 else:
  return None

def get_local_branch ( ) : if is_git_repo ( ) : ( o , _ ) = Popen ( u'git branch | grep "\\* "' , shell = True , stdout = PIPE , cwd = os . path . dirname ( nipype . __file__ ) ) . communicate ( ) return o . strip ( ) [ 2 : ] else : return None
determine current branch .