Documentation
¶
Overview ¶
Package gitdiscover finds git repositories near a directory: the enclosing repo (upward walk, same discovery rule as git itself) and immediate sub-repositories (one level down). Pure filesystem probes — no git binary, no I/O errors surfaced: every failure degrades to "no candidates" so discovery can never block pane creation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Candidates ¶
Candidates returns the repos to offer for dir: the enclosing repo first (if any), then one-level sub-repos, deduplicated, absolute paths.
ctx bounds a scan that is still making progress — a directory with thousands of entries, or a slow-but-live network mount — and a cancelled scan returns what it already had rather than an error, matching how every other failure in this package degrades. It deliberately does NOT protect against a hung mount: a syscall already blocked in the kernel cannot be cancelled from Go, so the first stat against a dead NFS server hangs regardless. Read this as "bounded work", not "bounded time".
func EnclosingRepo ¶
EnclosingRepo walks up from dir and returns the first ancestor (or dir itself) containing a .git entry. Symlinks are resolved first to match the daemon's defaultCWD discipline.
func SubRepos ¶
SubRepos returns the immediate (one level down) subdirectories of dir that contain a .git entry. Returns nil on any read error.
ctx is checked between entries, so a large directory stops early when the caller gives up. It cannot interrupt a stat already blocked in the kernel — see Candidates for what that bound is and is not worth.
Types ¶
This section is empty.