summaryrefslogtreecommitdiffstats
path: root/lib/utils
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/git.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils/git.js b/lib/utils/git.js
index fc75ee3..52b1096 100644
--- a/lib/utils/git.js
+++ b/lib/utils/git.js
@@ -10,7 +10,7 @@ var fs = require('./fs');
var GIT_PREFIX = 'git+';
-function Git(tmpDir) {
+function Git() {
this.tmpDir;
this.cloned = {};
}
@@ -84,7 +84,7 @@ Git.prototype.resolveRoot = function(filepath) {
var relativeToGit, repoId;
// No git repo cloned, or file is not in a git repository
- if (!pathUtil.isInRoot(this.tmpDir, filepath)) return null;
+ if (!this.tmpDir || !pathUtil.isInRoot(this.tmpDir, filepath)) return null;
// Extract first directory (is the repo id)
relativeToGit = path.relative(this.tmpDir, filepath);