mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 08:00:05 +01:00
update comments to reflect git install changes
Signed-off-by: Benoit Gagnon <benoit.gagnon@ubisoft.com>
This commit is contained in:
parent
1915ef519a
commit
ed7d84f846
1 changed files with 3 additions and 4 deletions
|
|
@ -168,12 +168,11 @@ func (p *GitPackage) Install(ctx context.Context, name, dir, version string) (st
|
||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
// Optimization for GitHub sources: download a tarball archive of the requested
|
// Optimization for GitHub sources: download a tarball archive of the requested
|
||||||
// version instead of cloning the entire repository. The SHA1 is discovered through
|
// version instead of cloning the entire repository.
|
||||||
// the ETag header included in the response.
|
|
||||||
isGitHubRemote, err := regexp.MatchString(`^(https|ssh)://github\.com/.+$`, p.Source.Remote)
|
isGitHubRemote, err := regexp.MatchString(`^(https|ssh)://github\.com/.+$`, p.Source.Remote)
|
||||||
if isGitHubRemote {
|
if isGitHubRemote {
|
||||||
// Let git ls-remote decide if "version" is a ref or a SHA1 in the unlikely
|
// Let git ls-remote decide if "version" is a ref or a commit SHA in the unlikely
|
||||||
// but possible event that a ref is exactly 40 hex characters
|
// but possible event that a ref is comprised of 40 or more hex characters
|
||||||
commitSha, err := remoteResolveRef(ctx, p.Source.Remote, version)
|
commitSha, err := remoteResolveRef(ctx, p.Source.Remote, version)
|
||||||
|
|
||||||
// If the ref resolution failed and "version" looks like a SHA,
|
// If the ref resolution failed and "version" looks like a SHA,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue