aboutsummaryrefslogtreecommitdiff
path: root/lib/detectLocalGit.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/detectLocalGit.js')
-rw-r--r--lib/detectLocalGit.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/detectLocalGit.js b/lib/detectLocalGit.js
index 3d381db..302cd44 100644
--- a/lib/detectLocalGit.js
+++ b/lib/detectLocalGit.js
@@ -5,7 +5,7 @@ var REGEX_BRANCH = /^ref: refs\/heads\/(\w+)$/;
module.exports = function detectLocalGit(knownCommit, knownBranch) {
var dir = process.cwd(), gitDir;
- while ('/' !== dir) {
+ while (path.resolve('/') !== dir) {
gitDir = path.join(dir, '.git');
var existsSync = fs.existsSync || path.existsSync;
if (existsSync(path.join(gitDir, 'HEAD')))
@@ -14,7 +14,7 @@ module.exports = function detectLocalGit(knownCommit, knownBranch) {
dir = path.dirname(dir);
}
- if ('/' === dir)
+ if (path.resolve('/') === dir)
return;
var head = fs.readFileSync(path.join(dir, '.git', 'HEAD'), 'utf-8').trim();