Skip to content

Commit f0a7ba9

Browse files
committed
Fix for changes in upstream dev-dependencies
1 parent 0e1e568 commit f0a7ba9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import process from 'node:process'
12
import path from 'node:path'
23
// @ts-expect-error: hush
34
import gitDiffTree from 'git-diff-tree'
@@ -66,8 +67,10 @@ export default function diff() {
6667
if (error) return next(error)
6768

6869
// Not testable in a Git repo…
69-
/* c8 ignore next */
70-
if (!git) return next(new Error('Not in a git repository'))
70+
/* c8 ignore next 3 */
71+
if (!git || !git.dirname) {
72+
return next(new Error('Not in a git repository'))
73+
}
7174

7275
cache[base] = git.dirname
7376
tick(git.dirname)

test/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import process from 'node:process'
12
import cp from 'node:child_process'
23
import fs from 'node:fs'
34
import path from 'node:path'

0 commit comments

Comments
 (0)