lint-staged 11.2.1 → 11.2.2

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.
@@ -26,6 +26,11 @@ const resolveGitConfigDir = async (gitDir) => {
26
26
  }
27
27
 
28
28
  const determineGitDir = (cwd, relativeDir) => {
29
+ // if relative dir and cwd have different endings normalize it
30
+ // this happens under windows, where normalize is unable to normalize git's output
31
+ if (relativeDir && relativeDir.endsWith(path.sep)) {
32
+ relativeDir = relativeDir.slice(0, -1)
33
+ }
29
34
  if (relativeDir) {
30
35
  // the current working dir is inside the git top-level directory
31
36
  return normalize(cwd.substring(0, cwd.lastIndexOf(relativeDir)))
@@ -65,3 +70,6 @@ const resolveGitRepo = async (cwd = process.cwd()) => {
65
70
  }
66
71
 
67
72
  module.exports = resolveGitRepo
73
+
74
+ // exported for test
75
+ module.exports.determineGitDir = determineGitDir
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lint-staged",
3
- "version": "11.2.1",
3
+ "version": "11.2.2",
4
4
  "description": "Lint files staged by git",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/okonet/lint-staged",