Return the root of the .git repository from the current directory.
()
| 31 | path_re = re.compile(r'Help/(?!dev|guide|manual|cpack_|release).*\.rst|Modules/[^/]*\.cmake$') |
| 32 | |
| 33 | def 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 | |
| 39 | def git_tags(): |
| 40 | """Return a list of CMake version tags from the repository.""" |