lint-staged 16.3.2 → 16.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/execGit.js +8 -0
- package/package.json +1 -1
package/lib/execGit.js
CHANGED
|
@@ -4,6 +4,9 @@ import { createDebug } from './debug.js'
|
|
|
4
4
|
|
|
5
5
|
const debugLog = createDebug('lint-staged:execGit')
|
|
6
6
|
|
|
7
|
+
/** @example "warning: in the working copy of 'README.md', LF will be replaced by CRLF the next time Git touches it" */
|
|
8
|
+
const GIT_CRLF_WARNING = /^warning.*CRLF.*the next time Git touches it/i
|
|
9
|
+
|
|
7
10
|
/**
|
|
8
11
|
* Explicitly never recurse commands into submodules, overriding local/global configuration.
|
|
9
12
|
* @see https://git-scm.com/docs/git-config#Documentation/git-config.txt-submodulerecurse
|
|
@@ -25,6 +28,11 @@ export const execGit = async (cmd, options) => {
|
|
|
25
28
|
|
|
26
29
|
let output = ''
|
|
27
30
|
for await (const line of result) {
|
|
31
|
+
if (GIT_CRLF_WARNING.test(line)) {
|
|
32
|
+
debugLog('Stripped Git CRLF warning: %s', line)
|
|
33
|
+
continue
|
|
34
|
+
}
|
|
35
|
+
|
|
28
36
|
output += line + '\n'
|
|
29
37
|
}
|
|
30
38
|
output = output.trimEnd()
|