parameters: (self)
return_statement: return branch
docstring: Get the current branch name, short form
          This returns "master", not "refs/head/master"
          Will not work if the current branch is detached
docstring_summary: Get the current branch name, short form
          This returns "master", not "refs/head/master"
          Will not work if the current branch is detached
docstring_tokens: Get the current branch name short form This returns master not refs / head / master Will not work if the current branch is detached
function: def get_branch_name(self):
          """Get the current branch name, short form
          This returns "master", not "refs/head/master"
          Will not work if the current branch is detached
          """
          branch = self.rev_parse(["--abbrev-ref", "HEAD"])
          if branch == "HEAD":
              raise ValueError("Branch is currently detached")
  
          return branch
function_tokens: def get_branch_name ( self ) : branch = self . rev_parse ( [ "--abbrev-ref" , "HEAD" ] ) if branch == "HEAD" : raise ValueError ( "Branch is currently detached" ) return branch