parameters: ()
return_statement: return branch_name != "(no branch)" and branch_name or None
docstring: Get the current branch.
docstring_summary: Get the current branch.
docstring_tokens: Get the current branch .
function: def current_branch():
      """
      Get the current branch.
      """
      proc = Popen([
          "git",
          "branch",
          "--no-color"
      ], stdout=PIPE, stderr=STDOUT)
  
      output = proc.communicate()[0].strip()
      if proc.returncode != 0:
          raise SCMError("branch error: %s" % output)
      branch_name = GIT_BRANCH_EXPR.findall(output)[0]
      return branch_name != "(no branch)" and branch_name or None
function_tokens: def current_branch ( ) : proc = Popen ( [ "git" , "branch" , "--no-color" ] , stdout = PIPE , stderr = STDOUT ) output = proc . communicate ( ) [ 0 ] . strip ( ) if proc . returncode != 0 : raise SCMError ( "branch error: %s" % output ) branch_name = GIT_BRANCH_EXPR . findall ( output ) [ 0 ] return branch_name != "(no branch)" and branch_name or None