Skip to content

Commit 4ce6857

Browse files
author
Robert Jackson
committed
Do not call path.resolve when no git path is found.
1 parent d06a079 commit 4ce6857

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,14 @@ module.exports = function(gitPath) {
125125
abbreviatedSha: null,
126126
branch: null,
127127
tag: null,
128-
root: path.resolve(gitPath, '..')
128+
root: null
129129
};
130130

131+
if (!gitPath) { return result; }
132+
131133
try {
134+
result.root = path.resolve(gitPath, '..');
135+
132136
var headFilePath = path.join(gitPath, 'HEAD');
133137

134138
if (fs.existsSync(headFilePath)) {

0 commit comments

Comments
 (0)