Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix test grouping and lint issues
  • Loading branch information
tbranyen committed Mar 24, 2015
commit 4c14cc1d2abf771c9fb04340ad0749071078c663
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ Index.prototype.addAll = function(pathspec, flags, matchedCallback) {
paths.push(path);
};
var idx = this;
var pathspec = Pathspec.create(pathspec || "*");
var ps = Pathspec.create(pathspec || "*");

return Status.foreach(repo, statusCB)
.then(function() {
return paths;
})
.then(function(paths) {
paths = paths.filter(function(path) {
return !!(pathspec.matchesPath(0, path));
return !!(ps.matchesPath(0, path));
});
return addAll.call(idx, paths, flags, matchedCallback, null);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"cov": "npm run cppcov && npm run filtercov && npm run mergecov",
"mocha": "mocha test/runner test/tests",
"mochaDebug": "mocha --debug-brk test/runner test/tests",
"test": "npm run lint && iojs --expose-gc test || node --expose-gc test",
"test": "npm run lint && (iojs --expose-gc test || node --expose-gc test)",
"generateJson": "node generate/scripts/generateJson",
"generateNativeCode": "node generate/scripts/generateNativeCode",
"generateMissingTests": "node generate/scripts/generateMissingTests",
Expand Down
4 changes: 2 additions & 2 deletions test/tests/pathspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ describe("Pathspec", function() {
});

it("can take files in an array", function() {
var pathspec = Pathspec.create(["gwendoline.txt", "sausolito.ogg"])
var pathspec = Pathspec.create(["gwendoline.txt", "sausolito.ogg"]);

assert.equal(pathspec.matchesPath(0, "gwendoline.txt"), 1);
assert.equal(pathspec.matchesPath(0, "sausolito.ogg"), 1);
assert.equal(pathspec.matchesPath(0, "sausolito.txt"), 0);
});

it("can handle dirs", function() {
var pathspec = Pathspec.create(["myDir/", "bob.js"])
var pathspec = Pathspec.create(["myDir/", "bob.js"]);

assert.equal(pathspec.matchesPath(0, "bob.js"), 1);
assert.equal(pathspec.matchesPath(0, "myDir/bob2.js"), 1);
Expand Down
4 changes: 2 additions & 2 deletions test/tests/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("Remote", function() {

it("can delete a remote", function() {
var repository = this.repository;
var remote = Remote.create(repository, "origin3", url);
Remote.create(repository, "origin3", url);

Remote.delete(repository, "origin3");

Expand Down Expand Up @@ -109,7 +109,7 @@ describe("Remote", function() {
var repo = this.repository;
var wasCalled = false;

var remote = Remote.create(repo, "test2", url2);
Remote.create(repo, "test2", url2);

return repo.getRemote("test2")
.then(function(remote) {
Expand Down