MCPcopy Create free account
hub / github.com/apache/solr / _find_git_root

Method _find_git_root

dev-tools/scripts/validateChangelogs.py:118–130  ·  view source on GitHub ↗

Find the git root directory.

()

Source from the content-addressed store, hash-verified

116
117 @staticmethod
118 def _find_git_root() -> Path:
119 """Find the git root directory."""
120 try:
121 result = subprocess.run(
122 ["git", "rev-parse", "--show-toplevel"],
123 capture_output=True,
124 text=True,
125 check=True
126 )
127 return Path(result.stdout.strip())
128 except subprocess.CalledProcessError:
129 print("Error: Not in a git repository")
130 sys.exit(1)
131
132 def run_git(self, args: List[str], check: bool = True) -> subprocess.CompletedProcess:
133 """Run a git command."""

Callers 1

__init__Method · 0.95

Calls 3

stripMethod · 0.80
runMethod · 0.65
exitMethod · 0.45

Tested by

no test coverage detected