MCPcopy Create free account
hub / github.com/Kitware/CMake / git_root

Function git_root

Utilities/Sphinx/update_versions.py:33–37  ·  view source on GitHub ↗

Return the root of the .git repository from the current directory.

()

Source from the content-addressed store, hash-verified

31path_re = re.compile(r'Help/(?!dev|guide|manual|cpack_|release).*\.rst|Modules/[^/]*\.cmake$')
32
33def git_root():
34 """Return the root of the .git repository from the current directory."""
35 result = subprocess.run(
36 ['git', 'rev-parse', '--show-toplevel'], check=True, universal_newlines=True, capture_output=True)
37 return pathlib.Path(result.stdout.strip())
38
39def git_tags():
40 """Return a list of CMake version tags from the repository."""

Callers 1

mainFunction · 0.85

Calls 2

PathMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…