in tools/url-checker/url_checker.py [0:0]
def get_repo_root():
"""Find the root directory of the Git repository."""
try:
return subprocess.check_output(['git', 'rev-parse', '--show-toplevel'], text=True).strip()
except subprocess.CalledProcessError:
return '.' # Default to current directory if not in a Git repo