diff --git a/@commitlint/read/src/index.js b/@commitlint/read/src/index.js index 9323a34a48..b9ae72e0b4 100644 --- a/@commitlint/read/src/index.js +++ b/@commitlint/read/src/index.js @@ -59,7 +59,7 @@ async function getEditFilePath(top, edit) { if (dotgitStats.isDirectory()) { editFilePath = path.join(top, '.git/COMMIT_EDITMSG'); } else { - const gitFile = await sander.readFile(dotgitPath, 'utf8'); + const gitFile = await sander.readFile(dotgitPath, {encoding: 'utf-8'}); const relativeGitPath = gitFile.replace('gitdir: ', '').replace('\n', ''); editFilePath = path.resolve(top, relativeGitPath, 'COMMIT_EDITMSG'); }