Documentation
¶
Overview ¶
Package gitclone is the first git-clone plumbing in this repo: a small shallow-clone helper for `sf plugin install <git-url>` (and, later, `sf pack install`). It shells out to the user's own `git`, so authentication is ambient — whatever ssh-agent, a credential helper, or ~/.netrc already trusts — sofia never reads, stores, or asks for a token itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneShallow ¶
CloneShallow clones url at ref into dst (which must not already exist) and returns the commit it landed on. ref is a branch or tag name; "" clones the remote's default branch. Commit SHAs are not supported — `git clone --branch` doesn't accept one, and resolving one would need a full clone.
func IsURL ¶
IsURL reports whether s names a git remote rather than a local path, by prefix alone (no regex, no network round-trip). Anything else — including relative and absolute filesystem paths — is treated as a local directory by the caller.
func RepoName ¶
RepoName derives a plugin/pack name from a git URL: the last path segment, with a trailing ".git" and any trailing slash stripped. It understands both URL form (scheme://host/path) and the scp-like shorthand git@host:path.
func RepoSlug ¶ added in v0.14.0
RepoSlug parses a git remote URL into its host and the last two path segments (owner, repo) — the GitHub "owner/repo" a release lives under. It understands the same URL and scp-like forms as RepoName (RepoName gives only the repo, discarding the owner and host this needs). A trailing ".git" and trailing slash are stripped; fewer than two path segments is an error, since there is then no owner to report.
Types ¶
This section is empty.