Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function getEditCommit(cwd, edit) {
const top = await toplevel(cwd);
if (typeof top !== 'string') {
throw new TypeError(`Could not find git root from ${cwd}`);
}
const editFilePath = await getEditFilePath(top, edit);
const editFile = await sander.readFile(editFilePath);
return [`${editFile.toString('utf-8')}\n`];
}