Skip to content

Commit

Permalink
Throw instead of returning cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
alizeait committed Mar 13, 2022
1 parent a5ac08a commit 08770b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/git/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ export async function deepenCloneBy({ by, cwd }: { by: number; cwd: string }) {
await spawn("git", ["fetch", `--deepen=${by}`], { cwd });
}
async function getRepoRoot({ cwd }: { cwd: string }) {
const { stdout, code } = await spawn(
const { stdout, code, stderr } = await spawn(
"git",
["rev-parse", "--show-toplevel"],
{ cwd }
);

if (code !== 0) {
return cwd;
throw new Error(stderr.toString());
}

return stdout
Expand Down

0 comments on commit 08770b0

Please sign in to comment.