Class CloneUrlIdentity
java.lang.Object
io.github.intisy.gradle.github.utils.CloneUrlIdentity
Derives an owner/repo-shaped identity from an arbitrary git clone URL, for use as a
cache-directory or cached-jar-file naming key only; never used to construct the actual clone
URL.
- Implementation Note:
ownercarries a hash of the full URL (the same techniqueUrlDownloadsuses for its download cache key), so two different hosts, or two different credentials on the same host, that happen to share an owner/repo-shaped path never derive the same identity: a git-existence check on a checkout directory has no way to compare itsoriginremote back against the URL that was requested. The URL is redacted before any segment of it becomes part of the identity, so a credential embedded in it (userinfo, a query token) can never land in a directory or file name; each segment is further sanitized against characters a filesystem path cannot contain (a rawhost:portembeds a:, which also breaksmkdirsconfusingly on Windows).
-
Method Summary
-
Method Details
-
derive
- Parameters:
cloneUrl- the URL to derive an identity from.- Returns:
- a two-element array,
{owner, repo}.
-