From 7fcfa5a8b3d56310e5afbac19e4e0524ebe885f0 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Mon, 5 Jun 2023 16:06:12 -0700 Subject: [PATCH] deps: @npmcli/git@4.1.0 --- lib/normalize.js | 16 +--------------- package.json | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/normalize.js b/lib/normalize.js index e604bf1..9594ef3 100644 --- a/lib/normalize.js +++ b/lib/normalize.js @@ -6,20 +6,6 @@ const path = require('path') const log = require('proc-log') const git = require('@npmcli/git') -// Replace with https://github.com/npm/git/pull/135 once it lands -const gitFind = async ({ cwd, root }) => { - if (await git.is({ cwd })) { - return cwd - } - while (cwd !== path.dirname(cwd) && cwd !== root) { - cwd = path.dirname(cwd) - if (await git.is({ cwd })) { - return cwd - } - } - return null -} - const normalize = async (pkg, { strict, steps, root }) => { const data = pkg.content const scripts = data.scripts || {} @@ -193,7 +179,7 @@ const normalize = async (pkg, { strict, steps, root }) => { // populate "gitHead" attribute if (steps.includes('gitHead') && !data.gitHead) { - const gitRoot = await gitFind({ cwd: pkg.path, root }) + const gitRoot = await git.find({ cwd: pkg.path, root }) let head if (gitRoot) { try { diff --git a/package.json b/package.json index d29a2e4..ada3be0 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "tap": "^16.0.1" }, "dependencies": { - "@npmcli/git": "^4.0.4", + "@npmcli/git": "^4.1.0", "glob": "^10.2.2", "json-parse-even-better-errors": "^3.0.0", "normalize-package-data": "^5.0.0",