lint-staged 17.0.2 → 17.0.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 +1 -0
- package/lib/gitWorkflow.js +16 -6
- package/package.json +1 -1
package/lib/execGit.js
CHANGED
package/lib/gitWorkflow.js
CHANGED
|
@@ -294,16 +294,26 @@ export class GitWorkflow {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
297
|
+
const gitIndexFile = process.env.GIT_INDEX_FILE
|
|
298
|
+
? normalizePath(process.env.GIT_INDEX_FILE)
|
|
299
|
+
: undefined
|
|
300
|
+
|
|
301
|
+
const adjustedGitIndexFile = gitIndexFile
|
|
302
|
+
? gitIndexFile.endsWith('.git/index.lock')
|
|
303
|
+
? // Relative and absolute default path should stay as-is
|
|
304
|
+
gitIndexFile
|
|
305
|
+
: // Non-default path is redirected to default
|
|
306
|
+
'.git/index.lock'
|
|
307
|
+
: undefined
|
|
302
308
|
|
|
303
309
|
debugLog('Updating Git index again after task modifications...')
|
|
304
310
|
|
|
305
311
|
// Update index for the files that were originally staged, ignore others
|
|
306
|
-
await this.execGit(['update-index', '--again']
|
|
312
|
+
await this.execGit(['update-index', '--again'], {
|
|
313
|
+
env: {
|
|
314
|
+
GIT_INDEX_FILE: adjustedGitIndexFile,
|
|
315
|
+
},
|
|
316
|
+
})
|
|
307
317
|
|
|
308
318
|
debugLog('Done updating Git index again after task modifications!')
|
|
309
319
|
|