Skip to content

Commit

Permalink
Exit code is 128 for no git dir
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmunro committed Jun 5, 2018
1 parent 73da366 commit 38fe875
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/git-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ function getClosestGitPath(currentPath) {
var result = execSync('git rev-parse --git-dir', {cwd: currentPath}).toString();
return result.replace(/\n/g, '');
} catch (error) {
// No git dir?
return undefined;
if (error.status === 128) {
// No git dir?
return undefined;
}
// Throw any other errors
throw error;
}
}

0 comments on commit 38fe875

Please sign in to comment.