Skip to content

Commit 3f0203a

Browse files
committed
Exit code is 128 for no git dir
1 parent b1aa91e commit 3f0203a

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
@@ -176,7 +176,11 @@ function getClosestGitPath(currentPath) {
176176
var result = execSync('git rev-parse --git-dir', {cwd: currentPath}).toString();
177177
return result.replace(/\n/g, '');
178178
} catch (error) {
179-
// No git dir?
180-
return undefined;
179+
if (error.status === 128) {
180+
// No git dir?
181+
return undefined;
182+
}
183+
// Throw any other errors
184+
throw error;
181185
}
182186
}

0 commit comments

Comments
 (0)