We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e1e568 commit f0a7ba9Copy full SHA for f0a7ba9
index.js
@@ -1,3 +1,4 @@
1
+import process from 'node:process'
2
import path from 'node:path'
3
// @ts-expect-error: hush
4
import gitDiffTree from 'git-diff-tree'
@@ -66,8 +67,10 @@ export default function diff() {
66
67
if (error) return next(error)
68
69
// Not testable in a Git repo…
- /* c8 ignore next */
70
- if (!git) return next(new Error('Not in a git repository'))
+ /* c8 ignore next 3 */
71
+ if (!git || !git.dirname) {
72
+ return next(new Error('Not in a git repository'))
73
+ }
74
75
cache[base] = git.dirname
76
tick(git.dirname)
test/index.js
import cp from 'node:child_process'
import fs from 'node:fs'
0 commit comments