Skip to content

Commit 7fcfa5a

Browse files
committed
deps: @npmcli/[email protected]
1 parent 9e0859b commit 7fcfa5a

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

lib/normalize.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,6 @@ const path = require('path')
66
const log = require('proc-log')
77
const git = require('@npmcli/git')
88

9-
// Replace with https://github.com/npm/git/pull/135 once it lands
10-
const gitFind = async ({ cwd, root }) => {
11-
if (await git.is({ cwd })) {
12-
return cwd
13-
}
14-
while (cwd !== path.dirname(cwd) && cwd !== root) {
15-
cwd = path.dirname(cwd)
16-
if (await git.is({ cwd })) {
17-
return cwd
18-
}
19-
}
20-
return null
21-
}
22-
239
const normalize = async (pkg, { strict, steps, root }) => {
2410
const data = pkg.content
2511
const scripts = data.scripts || {}
@@ -193,7 +179,7 @@ const normalize = async (pkg, { strict, steps, root }) => {
193179

194180
// populate "gitHead" attribute
195181
if (steps.includes('gitHead') && !data.gitHead) {
196-
const gitRoot = await gitFind({ cwd: pkg.path, root })
182+
const gitRoot = await git.find({ cwd: pkg.path, root })
197183
let head
198184
if (gitRoot) {
199185
try {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"tap": "^16.0.1"
3232
},
3333
"dependencies": {
34-
"@npmcli/git": "^4.0.4",
34+
"@npmcli/git": "^4.1.0",
3535
"glob": "^10.2.2",
3636
"json-parse-even-better-errors": "^3.0.0",
3737
"normalize-package-data": "^5.0.0",

0 commit comments

Comments
 (0)