| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,6 +12,7 @@ | |||
| 12 | 12 | baton->{{ arg.name }} = {{ arg.name }}; | |
| 13 | 13 | {% endeach %} | |
| 14 | 14 | ||
| 15 | + baton->result = 0; | ||
| 15 | 16 | baton->req.data = baton; | |
| 16 | 17 | baton->done = false; | |
| 17 | 18 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,24 +54,24 @@ | |||
| 54 | 54 | "node-pre-gyp" | |
| 55 | 55 | ], | |
| 56 | 56 | "dependencies": { | |
| 57 | - "fs-extra": "~0.15.0", | ||
| 57 | + "fs-extra": "^0.15.0", | ||
| 58 | 58 | "node-pre-gyp": "~0.6.1", | |
| 59 | 59 | "nodegit-promise": "~1.0.0", | |
| 60 | 60 | "npm": "^2.1.18", | |
| 61 | 61 | "promisify-node": "~0.1.2", | |
| 62 | 62 | "which-native-nodish": "^1.0.3" | |
| 63 | 63 | }, | |
| 64 | 64 | "devDependencies": { | |
| 65 | - "mocha": "~2.1.0", | ||
| 66 | 65 | "combyne": "~0.6.2", | |
| 67 | 66 | "istanbul": "~0.3.2", | |
| 68 | 67 | "js-beautify": "^1.5.4", | |
| 69 | - "jshint": "~2.5.6", | ||
| 68 | + "jshint": "^2.6.0", | ||
| 70 | 69 | "lodash": "^2.4.1", | |
| 71 | - "nan": "~1.5.0", | ||
| 70 | + "mocha": "~2.1.0", | ||
| 71 | + "nan": "^1.6.2", | ||
| 72 | 72 | "node-gyp": "~1.0.2", | |
| 73 | 73 | "nw-gyp": "^0.12.4", | |
| 74 | - "request": "~2.51.0", | ||
| 74 | + "request": "^2.53.0", | ||
| 75 | 75 | "tar": "~1.0.1" | |
| 76 | 76 | }, | |
| 77 | 77 | "binary": { | |
@@ -85,19 +85,14 @@ | |||
| 85 | 85 | "mocha": "mocha test/runner test/tests", | |
| 86 | 86 | "mochaDebug": "mocha --debug-brk test/runner test/tests", | |
| 87 | 87 | "test": "npm run lint && npm run cov", | |
| 88 | - | ||
| 89 | 88 | "generateJson": "node generate/scripts/generateJson", | |
| 90 | 89 | "generateNativeCode": "node generate/scripts/generateNativeCode", | |
| 91 | 90 | "generateMissingTests": "node generate/scripts/generateMissingTests", | |
| 92 | - | ||
| 93 | - | ||
| 94 | 91 | "prepublish": "node lifecycleScripts/prepareForBuild.js", | |
| 95 | 92 | "publish": "node-pre-gyp package && node-pre-gyp publish", | |
| 96 | - | ||
| 97 | 93 | "install": "node lifecycleScripts/install", | |
| 98 | 94 | "installDebug": "BUILD_DEBUG=true npm install", | |
| 99 | 95 | "postinstall": "node lifecycleScripts/clean", | |
| 100 | - | ||
| 101 | 96 | "recompile": "node-gyp configure build", | |
| 102 | 97 | "rebuild": "node generate && node-gyp configure build", | |
| 103 | 98 | "recompileDebug": "node-gyp configure --debug build", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,14 +1,20 @@ | |||
| 1 | + var fork = require("child_process").fork; | ||
| 2 | + var path = require("path"); | ||
| 3 | + var local = path.join.bind(path, __dirname); | ||
| 4 | + | ||
| 1 | 5 | var args = [ | |
| 2 | - "cover", | ||
| 3 | - process.platform != "win32" ? "_mocha" : "../node_modules/mocha/bin/_mocha", | ||
| 4 | - "--", | ||
| 5 | - "runner", | ||
| 6 | - "tests", | ||
| 7 | - "--report=lcov", | ||
| 8 | - "--expose-gc" | ||
| 9 | - ]; | ||
| 6 | + "cover", | ||
| 7 | + process.platform != "win32" ? | ||
| 8 | + "_mocha" : | ||
| 9 | + local("../node_modules/mocha/bin/_mocha"), | ||
| 10 | + "--", | ||
| 11 | + "runner", | ||
| 12 | + "tests", | ||
| 13 | + "--report=lcov", | ||
| 14 | + "--expose-gc" | ||
| 15 | + ]; | ||
| 10 | 16 | ||
| 11 | - require("child_process").fork("../node_modules/istanbul/lib/cli.js", args, { | ||
| 17 | + fork(local("../node_modules/istanbul/lib/cli.js"), args, { | ||
| 12 | 18 | cwd: __dirname | |
| 13 | 19 | }).on("close", function(code) { | |
| 14 | 20 | process.exit(code); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,37 +1,47 @@ | |||
| 1 | 1 | var promisify = require("promisify-node"); | |
| 2 | 2 | var fse = promisify("fs-extra"); | |
| 3 | + var path = require("path"); | ||
| 4 | + var local = path.join.bind(path, __dirname); | ||
| 3 | 5 | ||
| 4 | 6 | // Have to wrap exec, since it has a weird callback signature. | |
| 5 | 7 | var exec = promisify(function(command, opts, callback) { | |
| 6 | 8 | return require("child_process").exec(command, opts, callback); | |
| 7 | 9 | }); | |
| 8 | 10 | ||
| 9 | - before(function(done) { | ||
| 11 | + var workdirPath = local("repos/workdir"); | ||
| 12 | + | ||
| 13 | + before(function() { | ||
| 10 | 14 | this.timeout(350000); | |
| 11 | 15 | ||
| 12 | 16 | var url = "https://github.com/nodegit/test"; | |
| 13 | - var done = done.bind(null, null); | ||
| 14 | - | ||
| 15 | - function initEmpty() { | ||
| 16 | - return exec("git init test/repos/empty"); | ||
| 17 | - } | ||
| 18 | - | ||
| 19 | - fse.removeSync("test/repos") | ||
| 20 | - | ||
| 21 | - fse.mkdir("test/repos").then(initEmpty, initEmpty) | ||
| 22 | - .then(function() { | ||
| 23 | - return exec("git clone " + url + " test/repos/workdir"); | ||
| 24 | - }).then(function() { | ||
| 25 | - return exec("git checkout rev-walk", {cwd: "test/repos/workdir"}) | ||
| 26 | - }).then(function() { | ||
| 27 | - return exec("git checkout master", {cwd: "test/repos/workdir"}) | ||
| 28 | - }).then(function() { | ||
| 29 | - var nonrepo = "test/repos/nonrepo"; | ||
| 30 | - | ||
| 31 | - function writeBogus() { | ||
| 32 | - return fse.writeFile(nonrepo + "/file.txt", "This is a bogus file"); | ||
| 33 | - } | ||
| 17 | + return fse.remove(local("repos")) | ||
| 18 | + .then(function() { | ||
| 19 | + fse.mkdir(local("repos")); | ||
| 20 | + }) | ||
| 21 | + .then(function() { | ||
| 22 | + return exec("git init " + local("repos", "empty")); | ||
| 23 | + }) | ||
| 24 | + .then(function() { | ||
| 25 | + return exec("git clone " + url + " " + workdirPath); | ||
| 26 | + }) | ||
| 27 | + .then(function() { | ||
| 28 | + return exec("git checkout rev-walk", {cwd: workdirPath}); | ||
| 29 | + }) | ||
| 30 | + .then(function() { | ||
| 31 | + return exec("git checkout master", {cwd: workdirPath}); | ||
| 32 | + }) | ||
| 33 | + .then(function() { | ||
| 34 | + return fse.mkdir(local("repos", "nonrepo")); | ||
| 35 | + }) | ||
| 36 | + .then(function() { | ||
| 37 | + return fse.writeFile(local("repos", "nonrepo", "file.txt"), | ||
| 38 | + "This is a bogus file"); | ||
| 39 | + }); | ||
| 40 | + }); | ||
| 34 | 41 | ||
| 35 | - return fse.mkdir(nonrepo).then(writeBogus, writeBogus); | ||
| 36 | - }).then(done, done); | ||
| 42 | + beforeEach(function() { | ||
| 43 | + return exec("git clean -xdf", {cwd: workdirPath}) | ||
| 44 | + .then(function() { | ||
| 45 | + return exec("git reset --hard", {cwd: workdirPath}); | ||
| 46 | + }); | ||
| 37 | 47 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,19 +1,21 @@ | |||
| 1 | 1 | var assert = require("assert"); | |
| 2 | 2 | var path = require("path"); | |
| 3 | + var local = path.join.bind(path, __dirname); | ||
| 3 | 4 | ||
| 4 | 5 | describe("Attr", function() { | |
| 5 | - var reposPath = path.resolve("test/repos/workdir/.git"); | ||
| 6 | + var Repository = require(local("../../lib/repository")); | ||
| 7 | + var Attr = require(local("../../lib/attr")); | ||
| 8 | + var Status = require(local("../../lib/status")); | ||
| 6 | 9 | ||
| 7 | - var Repository = require("../../lib/repository"); | ||
| 8 | - var Attr = require("../../lib/attr"); | ||
| 9 | - var Status = require("../../lib/status"); | ||
| 10 | + var reposPath = local("../repos/workdir/.git"); | ||
| 10 | 11 | ||
| 11 | 12 | before(function() { | |
| 12 | 13 | var test = this; | |
| 13 | 14 | ||
| 14 | - return Repository.open(reposPath).then(function(repository) { | ||
| 15 | - test.repository = repository; | ||
| 16 | - }); | ||
| 15 | + return Repository.open(reposPath) | ||
| 16 | + .then(function(repository) { | ||
| 17 | + test.repository = repository; | ||
| 18 | + }); | ||
| 17 | 19 | }); | |
| 18 | 20 | ||
| 19 | 21 | it("can add a macro definition", function() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,24 +1,27 @@ | |||
| 1 | 1 | var assert = require("assert"); | |
| 2 | 2 | var path = require("path"); | |
| 3 | + var local = path.join.bind(path, __dirname); | ||
| 3 | 4 | ||
| 4 | 5 | describe("Blob", function() { | |
| 5 | - var reposPath = path.resolve("test/repos/workdir/.git"); | ||
| 6 | - var oid = "111dd657329797f6165f52f5085f61ac976dcf04"; | ||
| 6 | + var Oid = require(local("../../lib/oid")); | ||
| 7 | + var Repository = require(local("../../lib/repository")); | ||
| 8 | + var FileMode = require(local("../../lib/tree_entry")).FILEMODE; | ||
| 7 | 9 | ||
| 8 | - var Oid = require("../../lib/oid"); | ||
| 9 | - var Repository = require("../../lib/repository"); | ||
| 10 | - var FileMode = require("../../lib/tree_entry").FILEMODE; | ||
| 10 | + var reposPath = local("../repos/workdir/.git"); | ||
| 11 | + var oid = "111dd657329797f6165f52f5085f61ac976dcf04"; | ||
| 11 | 12 | ||
| 12 | 13 | before(function() { | |
| 13 | 14 | var test = this; | |
| 14 | 15 | ||
| 15 | - return Repository.open(reposPath).then(function(repository) { | ||
| 16 | - test.repository = repository; | ||
| 16 | + return Repository.open(reposPath) | ||
| 17 | + .then(function(repository) { | ||
| 18 | + test.repository = repository; | ||
| 17 | 19 | ||
| 18 | - return repository.getBlob(oid).then(function(blob) { | ||
| 20 | + return repository.getBlob(oid); | ||
| 21 | + }) | ||
| 22 | + .then(function(blob) { | ||
| 19 | 23 | test.blob = blob; | |
| 20 | 24 | }); | |
| 21 | - }); | ||
| 22 | 25 | }); | |
| 23 | 26 | ||
| 24 | 27 | it("can provide content as a buffer", function() { | |
@@ -40,8 +43,9 @@ describe("Blob", function() { | |||
| 40 | 43 | ||
| 41 | 44 | it("can get a blob with an Oid object", function() { | |
| 42 | 45 | var oidObject = Oid.fromString(oid); | |
| 43 | - this.repository.getBlob(oidObject).then(function(blob) { | ||
| 44 | - assert.equal(this.blob.id().toString(), oid); | ||
| 45 | - }); | ||
| 46 | + return this.repository.getBlob(oidObject) | ||
| 47 | + .then(function(blob) { | ||
| 48 | + assert.equal(blob.id().toString(), oid); | ||
| 49 | + }); | ||
| 46 | 50 | }); | |
| 47 | 51 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments