MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / get_current_branch

Method get_current_branch

tests/utils.py:85–90  ·  view source on GitHub ↗

Get current git branch name.

(self)

Source from the content-addressed store, hash-verified

83 self.tick()
84
85 def get_current_branch(self) -> str:
86 """Get current git branch name."""
87 c = cmd.run(["git", "rev-parse", "--abbrev-ref", "HEAD"])
88 if c.return_code != 0:
89 raise exceptions.GitCommandError(c.err)
90 return c.out.strip()
91
92 def create_tag(
93 self, tag: str, message: str | None = None, annotated: bool | None = None

Calls

no outgoing calls