True when SLOC_GIT_HOST_ALLOWLIST names at least one host. Callers use this to decide
whether network operations that fetch attacker-influenced URLs (e.g. submodule population
on a network-facing server) may proceed under the positive allowlist.
True when s points at an existing local git repository — a directory containing a
.git entry (working tree or worktree/submodule pointer) or a bare repository dir.
Like list_refs, but for a repository operated on in place (a local checkout the
user pointed us at). It lists the repo’s local branch heads (git branch) rather than
remote-tracking refs (git branch -r), because a working repo’s branches of interest are
its local heads. Tags and recent commits are listed identically to list_refs.
Verify that path is inside a git repository and return the canonical repository root
(the working-tree top level, or the given path for a bare repo). Runs no network I/O.
Recursively check out a super-repo’s submodules inside worktree so their files are
present for analysis. Best-effort: a repo with no .gitmodules is a no-op, and a
submodule whose fetch fails simply stays empty (its per-submodule breakdown is then blank)
rather than failing the whole scan.
Publish the contents of src_dir into repo_url on branch, under subdir, as a single
commit, then push. work_dir is a caller-owned empty scratch directory used as the clone
working tree.