feat: admit existing OpenBao catalog lanes
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s

This commit is contained in:
tegwick 2026-08-21 08:20:33 +02:00
parent 9d383442c8
commit 784be978bf
29 changed files with 1490 additions and 79 deletions

View file

@ -0,0 +1,20 @@
"""Filesystem checks shared by secret provisioning and handoff paths."""
from __future__ import annotations
from pathlib import Path
def containing_git_worktree(path: Path) -> Path | None:
"""Return the nearest enclosing Git worktree, if one is identifiable.
A real worktree has either a ``.git`` file (linked worktrees/submodules) or
a ``.git`` directory containing ``HEAD``. Merely finding an empty directory
named ``.git`` is not enough; sandbox and test environments may use such a
marker outside any repository.
"""
resolved = path.expanduser().resolve()
for parent in (resolved.parent, *resolved.parent.parents):
marker = parent / ".git"
if marker.is_file() or (marker.is_dir() and (marker / "HEAD").is_file()):
return parent
return None