Skip to content

Commit

Permalink
deps: @npmcli/git@4.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Mar 23, 2023
1 parent 57c0a55 commit 9a7b8e8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 29 deletions.
1 change: 0 additions & 1 deletion DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,6 @@ graph LR;
npmcli-docs-->yaml;
npmcli-fs-->semver;
npmcli-git-->lru-cache;
npmcli-git-->mkdirp;
npmcli-git-->npm-pick-manifest;
npmcli-git-->npmcli-promise-spawn["@npmcli/promise-spawn"];
npmcli-git-->proc-log;
Expand Down
35 changes: 18 additions & 17 deletions node_modules/@npmcli/git/lib/clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ const spawn = require('./spawn.js')
const { isWindows } = require('./utils.js')

const pickManifest = require('npm-pick-manifest')
const fs = require('fs')
const mkdirp = require('mkdirp')
const fs = require('fs/promises')

module.exports = (repo, ref = 'HEAD', target = null, opts = {}) =>
getRevs(repo, opts).then(revs => clone(
Expand Down Expand Up @@ -93,7 +92,7 @@ const other = (repo, revDoc, target, opts) => {
.concat(shallow ? ['--depth=1'] : [])

const git = (args) => spawn(args, { ...opts, cwd: target })
return mkdirp(target)
return fs.mkdir(target, { recursive: true })
.then(() => git(['init']))
.then(() => isWindows(opts)
? git(['config', '--local', '--add', 'core.longpaths', 'true'])
Expand Down Expand Up @@ -141,27 +140,29 @@ const plain = (repo, revDoc, target, opts) => {
return spawn(args, opts).then(() => revDoc.sha)
}

const updateSubmodules = (target, opts) => new Promise(resolve =>
fs.stat(target + '/.gitmodules', er => {
if (er) {
return resolve(null)
}
return resolve(spawn([
'submodule',
'update',
'-q',
'--init',
'--recursive',
], { ...opts, cwd: target }))
}))
const updateSubmodules = async (target, opts) => {
const hasSubmodules = await fs.stat(`${target}/.gitmodules`)
.then(() => true)
.catch(() => false)
if (!hasSubmodules) {
return null
}
return spawn([
'submodule',
'update',
'-q',
'--init',
'--recursive',
], { ...opts, cwd: target })
}

const unresolved = (repo, ref, target, opts) => {
// can't do this one shallowly, because the ref isn't advertised
// but we can avoid checking out the working dir twice, at least
const lp = isWindows(opts) ? ['--config', 'core.longpaths=true'] : []
const cloneArgs = ['clone', '--mirror', '-q', repo, target + '/.git']
const git = (args) => spawn(args, { ...opts, cwd: target })
return mkdirp(target)
return fs.mkdir(target, { recursive: true })
.then(() => git(cloneArgs.concat(lp)))
.then(() => git(['init']))
.then(() => git(['checkout', ref]))
Expand Down
8 changes: 3 additions & 5 deletions node_modules/@npmcli/git/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/git",
"version": "4.0.3",
"version": "4.0.4",
"main": "lib/index.js",
"files": [
"bin/",
Expand Down Expand Up @@ -32,16 +32,14 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.8.0",
"@npmcli/template-oss": "4.12.0",
"npm-package-arg": "^10.0.0",
"rimraf": "^3.0.2",
"slash": "^3.0.0",
"tap": "^16.0.1"
},
"dependencies": {
"@npmcli/promise-spawn": "^6.0.0",
"lru-cache": "^7.4.4",
"mkdirp": "^1.0.4",
"npm-pick-manifest": "^8.0.0",
"proc-log": "^3.0.0",
"promise-inflight": "^1.0.1",
Expand All @@ -55,6 +53,6 @@
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"windowsCI": false,
"version": "4.8.0"
"version": "4.12.0"
}
}
9 changes: 4 additions & 5 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"@npmcli/docs": "^1.0.0",
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/fs": "^3.1.0",
"@npmcli/git": "^4.0.1",
"@npmcli/git": "^4.0.4",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/promise-spawn": "^6.0.2",
"@npmcli/template-oss": "4.12.0",
Expand Down Expand Up @@ -2100,14 +2100,13 @@
}
},
"node_modules/@npmcli/git": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.0.3.tgz",
"integrity": "sha512-8cXNkDIbnXPVbhXMmQ7/bklCAjtmPaXfI9aEM4iH+xSuEHINLMHhlfESvVwdqmHJRJkR48vNJTSUvoF6GRPSFA==",
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.0.4.tgz",
"integrity": "sha512-5yZghx+u5M47LghaybLCkdSyFzV/w4OuH12d96HO389Ik9CDsLaDZJVynSGGVJOLn6gy/k7Dz5XYcplM3uxXRg==",
"inBundle": true,
"dependencies": {
"@npmcli/promise-spawn": "^6.0.0",
"lru-cache": "^7.4.4",
"mkdirp": "^1.0.4",
"npm-pick-manifest": "^8.0.0",
"proc-log": "^3.0.0",
"promise-inflight": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"@npmcli/docs": "^1.0.0",
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/fs": "^3.1.0",
"@npmcli/git": "^4.0.1",
"@npmcli/git": "^4.0.4",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/promise-spawn": "^6.0.2",
"@npmcli/template-oss": "4.12.0",
Expand Down

0 comments on commit 9a7b8e8

Please sign in to comment.