diff --git a/lib/tree_entry.js b/lib/tree_entry.js index a65d85172..b9bc0fd72 100644 --- a/lib/tree_entry.js +++ b/lib/tree_entry.js @@ -1,4 +1,4 @@ -var path = require("path"); +var path = require("path").posix; var NodeGit = require("../"); var TreeEntry = NodeGit.TreeEntry; diff --git a/test/tests/tree.js b/test/tests/tree.js index aa98d4f3d..0790759f5 100644 --- a/test/tests/tree.js +++ b/test/tests/tree.js @@ -44,8 +44,7 @@ describe("Tree", function() { var repo = this.repository; var file1 = "test.txt"; var file2 = "foo/bar.txt"; - // index.addByPath doesn't like \s so normalize only for the expected paths - var expectedPaths = [file1, path.normalize(file2)]; + var expectedPaths = [file1, file2]; var progressEntries = []; var endEntries; diff --git a/test/tests/tree_entry.js b/test/tests/tree_entry.js index 13093fdaa..086a4f8d2 100644 --- a/test/tests/tree_entry.js +++ b/test/tests/tree_entry.js @@ -57,7 +57,7 @@ describe("TreeEntry", function() { it("provides the full path", function() { return this.commit.getEntry("test/raw-commit.js") .then(function(entry) { - assert.equal(entry.path(), path.normalize("test/raw-commit.js")); + assert.equal(entry.path(), "test/raw-commit.js"); }); }); @@ -66,7 +66,7 @@ describe("TreeEntry", function() { var dir = _dir || "", testPromises = []; tree.entries().forEach(function(entry) { - var currentPath = path.join(dir, entry.name()); + var currentPath = path.posix.join(dir, entry.name()); if (entry.isTree()) { testPromises.push( entry.getTree().then(function (subtree) {