Skip to content

Commit 5bcb7ca

Browse files
committed
Exit code is 128 for no git dir
1 parent 3e5b949 commit 5bcb7ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/git-hooks.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ function getClosestGitPath(currentPath) {
182182
var result = execSync('git rev-parse --git-dir', {cwd: currentPath}).toString();
183183
return result.replace(/\n/g, '');
184184
} catch (error) {
185-
// No git dir?
186-
return undefined;
185+
if (error.status === 128) {
186+
// No git dir?
187+
return undefined;
188+
}
189+
// Throw any other errors
190+
throw error;
187191
}
188192
}

0 commit comments

Comments
 (0)