summaryrefslogtreecommitdiffstats
path: root/lib/utils/git.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-14 22:49:55 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-14 22:49:55 +0100
commitfef822145d43d80dbbefa8712eab88ad7044d6c1 (patch)
tree611af2ef4292e9e9a918c2840db2a65b7efdd587 /lib/utils/git.js
parentcfefa7d57992738373649dab16cbaf4754c3e5c7 (diff)
downloadgitbook-fef822145d43d80dbbefa8712eab88ad7044d6c1.zip
gitbook-fef822145d43d80dbbefa8712eab88ad7044d6c1.tar.gz
gitbook-fef822145d43d80dbbefa8712eab88ad7044d6c1.tar.bz2
Move conrefs to a separate mixin
Diffstat (limited to 'lib/utils/git.js')
-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);