aboutsummaryrefslogtreecommitdiff
path: root/lib/detectLocalGit.js
diff options
context:
space:
mode:
authorGerard Escalante <[email protected]>2014-02-11 11:10:34 +0900
committerGerard Escalante <[email protected]>2014-02-11 11:10:34 +0900
commitab1c7aeda0359fb174e4dbfdb7e117cc029eb329 (patch)
treefc7a02bb26f448233c9626704d499cca30c6d327 /lib/detectLocalGit.js
parent7f7dad83d26e0d3c3326c260926acfcb6e05fa58 (diff)
downloadnode-coveralls-ab1c7aeda0359fb174e4dbfdb7e117cc029eb329.tar.xz
node-coveralls-ab1c7aeda0359fb174e4dbfdb7e117cc029eb329.zip
Windows compat fixes
Changed usage of '/' as root dir. Stopped tests from wiping out environment.
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();