Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pnpm/git-resolver

Package Overview
Dependencies
Maintainers
2
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/git-resolver - npm Package Compare versions

Comparing version 5.0.2 to 5.1.0

6

CHANGELOG.md
# @pnpm/git-resolver
## 5.1.0
### Minor Changes
- 69ffc4099: It should be possible to install a Git-hosted dependency that names the default branch not "master".
## 5.0.2

@@ -4,0 +10,0 @@

15

lib/index.js

@@ -16,3 +16,3 @@ "use strict";

const pref = parsedSpec.gitCommittish == null || parsedSpec.gitCommittish === ''
? 'master'
? 'HEAD'
: parsedSpec.gitCommittish;

@@ -54,3 +54,6 @@ const commit = await resolveRef(parsedSpec.fetchSpec, pref, parsedSpec.gitRange);

async function getRepoRefs(repo, ref) {
const gitArgs = ['ls-remote', '--refs', repo];
const gitArgs = [repo];
if (ref !== 'HEAD') {
gitArgs.unshift('--refs');
}
if (ref) {

@@ -60,7 +63,5 @@ gitArgs.push(ref);

// graceful-git by default retries 10 times, reduce to single retry
const result = await graceful_git_1.default(gitArgs, { retries: 1 });
const result = await graceful_git_1.default(['ls-remote', ...gitArgs], { retries: 1 });
const refs = result.stdout.split('\n').reduce((obj, line) => {
const commitAndRef = line.split('\t');
const commit = commitAndRef[0];
const refName = commitAndRef[1];
const [commit, refName] = line.split('\t');
obj[refName] = commit;

@@ -72,3 +73,3 @@ return obj;

async function resolveRef(repo, ref, range) {
if (ref.match(/^[0-9a-f]{40}$/) != null) {
if (ref.match(/^[0-9a-f]{7,40}$/) != null) {
return ref;

@@ -75,0 +76,0 @@ }

{
"name": "@pnpm/git-resolver",
"version": "5.0.2",
"version": "5.1.0",
"description": "Resolver for git-hosted packages",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc