From 4f2900e78a3565a1f7e1ea386769cded1650e860 Mon Sep 17 00:00:00 2001 From: Victoria Fierce Date: Thu, 3 Aug 2023 12:00:30 +0200 Subject: [PATCH] Support .git symlinks For large projects that use google's 'repo' tool, .git is actually a symlink to somewhere else. lstat() only reads the symlink itself, not the target of the symlink, leading to errors like EISDIR: illegal operation on a directory, read --- @commitlint/read/src/get-edit-file-path.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/@commitlint/read/src/get-edit-file-path.ts b/@commitlint/read/src/get-edit-file-path.ts index d90ac6b7b3..1d80d00fc9 100644 --- a/@commitlint/read/src/get-edit-file-path.ts +++ b/@commitlint/read/src/get-edit-file-path.ts @@ -12,7 +12,7 @@ export async function getEditFilePath( } const dotgitPath = path.join(top, '.git'); - const dotgitStats: Stats = await fs.lstat(dotgitPath); + const dotgitStats: Stats = await fs.stat(dotgitPath); if (dotgitStats.isDirectory()) { return path.join(top, '.git/COMMIT_EDITMSG');