(p: string)
| 123 | } |
| 124 | |
| 125 | export function normalizePathPattern(p: string): string { |
| 126 | if (process.platform !== "win32") return p |
| 127 | if (p === "*") return p |
| 128 | const match = p.match(/^(.*)[\\/]\*$/) |
| 129 | if (!match) return normalizePath(p) |
| 130 | const dir = /^[A-Za-z]:$/.test(match[1]) ? match[1] + "\\" : match[1] |
| 131 | return join(normalizePath(dir), "*") |
| 132 | } |
| 133 | |
| 134 | // We cannot rely on path.resolve() here because git.exe may come from Git Bash, Cygwin, or MSYS2, so we need to translate these paths at the boundary. |
| 135 | // Also resolves symlinks so that callers using the result as a cache key |
nothing calls this directly
no test coverage detected