We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e8383e commit 886f9c2Copy full SHA for 886f9c2
1 file changed
extensions/git/src/util.ts
@@ -303,6 +303,10 @@ export function detectUnicodeEncoding(buffer: Buffer): Encoding | null {
303
return null;
304
}
305
306
+function isWindowsPath(path: string): boolean {
307
+ return /^[a-zA-Z]:\\/.test(path);
308
+}
309
+
310
export function isDescendant(parent: string, descendant: string): boolean {
311
if (parent === descendant) {
312
return true;
@@ -312,5 +316,11 @@ export function isDescendant(parent: string, descendant: string): boolean {
316
parent += sep;
313
317
314
318
319
+ // Windows is case insensitive
320
+ if (isWindowsPath(parent)) {
321
+ parent = parent.toLowerCase();
322
+ descendant = descendant.toLowerCase();
323
+ }
324
315
325
return descendant.startsWith(parent);
326
0 commit comments