Skip to content

Commit 6fa028a

Browse files
committed
wtf?
1 parent 9eae810 commit 6fa028a

3 files changed

Lines changed: 163 additions & 163 deletions

File tree

‎test/index.js‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
var fork = require("child_process").fork;
2-
var path = require("path");
3-
var local = path.join.bind(path, __dirname);
4-
5-
var args = [
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-
];
16-
17-
fork(local("../node_modules/istanbul/lib/cli.js"), args, {
18-
cwd: __dirname
19-
}).on("close", function(code) {
20-
process.exit(code);
21-
});
1+
var fork = require("child_process").fork;
2+
var path = require("path");
3+
var local = path.join.bind(path, __dirname);
4+
5+
var args = [
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+
];
16+
17+
fork(local("../node_modules/istanbul/lib/cli.js"), args, {
18+
cwd: __dirname
19+
}).on("close", function(code) {
20+
process.exit(code);
21+
});

‎test/runner.js‎

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
var promisify = require("promisify-node");
2-
var fse = promisify("fs-extra");
3-
var path = require("path");
4-
var local = path.join.bind(path, __dirname);
5-
6-
// Have to wrap exec, since it has a weird callback signature.
7-
var exec = promisify(function(command, opts, callback) {
8-
return require("child_process").exec(command, opts, callback);
9-
});
10-
11-
before(function() {
12-
this.timeout(350000);
13-
14-
var url = "https://github.com/nodegit/test";
15-
return fse.remove(local("repos"))
16-
.then(function() {
17-
fse.mkdir(local("repos"));
18-
})
19-
.then(function() {
20-
return exec("git init " + local("repos", "empty"));
21-
})
22-
.then(function() {
23-
return exec("git clone " + url + " " + local("repos", "workdir"));
24-
}).then(function() {
25-
return exec("git checkout rev-walk", {cwd: local("repos", "workdir")})
26-
}).then(function() {
27-
return exec("git checkout master", {cwd: local("repos", "workdir")})
28-
}).then(function() {
29-
return fse.mkdir(local("repos", "nonrepo"));
30-
}).then(function() {
31-
return fse.writeFile(local("repos", "nonrepo", "file.txt"),
32-
"This is a bogus file");
33-
});
34-
});
1+
var promisify = require("promisify-node");
2+
var fse = promisify("fs-extra");
3+
var path = require("path");
4+
var local = path.join.bind(path, __dirname);
5+
6+
// Have to wrap exec, since it has a weird callback signature.
7+
var exec = promisify(function(command, opts, callback) {
8+
return require("child_process").exec(command, opts, callback);
9+
});
10+
11+
before(function() {
12+
this.timeout(350000);
13+
14+
var url = "https://github.com/nodegit/test";
15+
return fse.remove(local("repos"))
16+
.then(function() {
17+
fse.mkdir(local("repos"));
18+
})
19+
.then(function() {
20+
return exec("git init " + local("repos", "empty"));
21+
})
22+
.then(function() {
23+
return exec("git clone " + url + " " + local("repos", "workdir"));
24+
}).then(function() {
25+
return exec("git checkout rev-walk", {cwd: local("repos", "workdir")})
26+
}).then(function() {
27+
return exec("git checkout master", {cwd: local("repos", "workdir")})
28+
}).then(function() {
29+
return fse.mkdir(local("repos", "nonrepo"));
30+
}).then(function() {
31+
return fse.writeFile(local("repos", "nonrepo", "file.txt"),
32+
"This is a bogus file");
33+
});
34+
});

‎test/tests/clone.js‎

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,108 @@
1-
var assert = require("assert");
2-
var path = require("path");
3-
var Promise = require("nodegit-promise");
4-
var promisify = require("promisify-node");
5-
var fse = promisify(require("fs-extra"));
6-
var local = path.join.bind(path, __dirname);
7-
8-
describe("Clone", function() {
9-
var http = local("../repos/http");
10-
var https = local("../repos/https");
11-
var ssh = local("../repos/ssh");
12-
var sshManual = local("../repos/sshmanual");
13-
var git = local("../repos/git");
14-
var file = local("../repos/file");
15-
16-
var sshPublicKey = local("../id_rsa.pub");
17-
var sshPrivateKey = local("../id_rsa");
18-
19-
var Repository = require(local("../../lib/repository"));
20-
var Clone = require(local("../../lib/clone"));
21-
var NodeGit = require(local("../../"));
22-
23-
// Set a reasonable timeout here now that our repository has grown.
24-
this.timeout(15000);
25-
26-
before(function() {
27-
return Promise.all([
28-
fse.remove(http),
29-
fse.remove(https),
30-
fse.remove(ssh),
31-
fse.remove(sshManual),
32-
fse.remove(git),
33-
fse.remove(file),
34-
]);
35-
});
36-
37-
it("can clone with http", function() {
38-
var url = "http://github.com/nodegit/test.git";
39-
var opts = { ignoreCertErrors: 1 };
40-
41-
return Clone.clone(url, http, opts).then(function(repository) {
42-
assert.ok(repository instanceof Repository);
43-
});
44-
});
45-
46-
it("can clone with https", function() {
47-
var url = "https://github.com/nodegit/test.git";
48-
var opts = { ignoreCertErrors: 1 };
49-
50-
return Clone.clone(url, https, opts).then(function(repository) {
51-
assert.ok(repository instanceof Repository);
52-
});
53-
});
54-
55-
it("can clone with ssh", function() {
56-
var url = "git@github.com:nodegit/test.git";
57-
var opts = {
58-
ignoreCertErrors: 1,
59-
remoteCallbacks: {
60-
credentials: function(url, userName) {
61-
return NodeGit.Cred.sshKeyFromAgent(userName);
62-
}
63-
}
64-
};
65-
66-
return Clone.clone(url, ssh, opts).then(function(repository) {
67-
assert.ok(repository instanceof Repository);
68-
});
69-
});
70-
71-
it("can clone with ssh while manually loading a key", function() {
72-
var url = "git@github.com:nodegit/test.git";
73-
var opts = {
74-
ignoreCertErrors: 1,
75-
remoteCallbacks: {
76-
credentials: function(url, userName) {
77-
return NodeGit.Cred.sshKeyNew(
78-
userName,
79-
sshPublicKey,
80-
sshPrivateKey,
81-
"");
82-
}
83-
}
84-
};
85-
86-
return Clone.clone(url, sshManual, opts).then(function(repository) {
87-
assert.ok(repository instanceof Repository);
88-
});
89-
});
90-
91-
it("can clone with git", function() {
92-
var url = "git://github.com/nodegit/test.git";
93-
var opts = { ignoreCertErrors: 1 };
94-
95-
return Clone.clone(url, git, opts).then(function(repository) {
96-
assert.ok(repository instanceof Repository);
97-
});
98-
});
99-
100-
it("can clone with filesystem", function() {
101-
var prefix = process.platform === "win32" ? "" : "file://";
102-
var url = prefix + local("../repos/empty");
103-
104-
return Clone.clone(url, file).then(function(repository) {
105-
assert.ok(repository instanceof Repository);
106-
});
107-
});
108-
});
1+
var assert = require("assert");
2+
var path = require("path");
3+
var Promise = require("nodegit-promise");
4+
var promisify = require("promisify-node");
5+
var fse = promisify(require("fs-extra"));
6+
var local = path.join.bind(path, __dirname);
7+
8+
describe("Clone", function() {
9+
var http = local("../repos/http");
10+
var https = local("../repos/https");
11+
var ssh = local("../repos/ssh");
12+
var sshManual = local("../repos/sshmanual");
13+
var git = local("../repos/git");
14+
var file = local("../repos/file");
15+
16+
var sshPublicKey = local("../id_rsa.pub");
17+
var sshPrivateKey = local("../id_rsa");
18+
19+
var Repository = require(local("../../lib/repository"));
20+
var Clone = require(local("../../lib/clone"));
21+
var NodeGit = require(local("../../"));
22+
23+
// Set a reasonable timeout here now that our repository has grown.
24+
this.timeout(15000);
25+
26+
before(function() {
27+
return Promise.all([
28+
fse.remove(http),
29+
fse.remove(https),
30+
fse.remove(ssh),
31+
fse.remove(sshManual),
32+
fse.remove(git),
33+
fse.remove(file),
34+
]);
35+
});
36+
37+
it("can clone with http", function() {
38+
var url = "http://github.com/nodegit/test.git";
39+
var opts = { ignoreCertErrors: 1 };
40+
41+
return Clone.clone(url, http, opts).then(function(repository) {
42+
assert.ok(repository instanceof Repository);
43+
});
44+
});
45+
46+
it("can clone with https", function() {
47+
var url = "https://github.com/nodegit/test.git";
48+
var opts = { ignoreCertErrors: 1 };
49+
50+
return Clone.clone(url, https, opts).then(function(repository) {
51+
assert.ok(repository instanceof Repository);
52+
});
53+
});
54+
55+
it("can clone with ssh", function() {
56+
var url = "git@github.com:nodegit/test.git";
57+
var opts = {
58+
ignoreCertErrors: 1,
59+
remoteCallbacks: {
60+
credentials: function(url, userName) {
61+
return NodeGit.Cred.sshKeyFromAgent(userName);
62+
}
63+
}
64+
};
65+
66+
return Clone.clone(url, ssh, opts).then(function(repository) {
67+
assert.ok(repository instanceof Repository);
68+
});
69+
});
70+
71+
it("can clone with ssh while manually loading a key", function() {
72+
var url = "git@github.com:nodegit/test.git";
73+
var opts = {
74+
ignoreCertErrors: 1,
75+
remoteCallbacks: {
76+
credentials: function(url, userName) {
77+
return NodeGit.Cred.sshKeyNew(
78+
userName,
79+
sshPublicKey,
80+
sshPrivateKey,
81+
"");
82+
}
83+
}
84+
};
85+
86+
return Clone.clone(url, sshManual, opts).then(function(repository) {
87+
assert.ok(repository instanceof Repository);
88+
});
89+
});
90+
91+
it("can clone with git", function() {
92+
var url = "git://github.com/nodegit/test.git";
93+
var opts = { ignoreCertErrors: 1 };
94+
95+
return Clone.clone(url, git, opts).then(function(repository) {
96+
assert.ok(repository instanceof Repository);
97+
});
98+
});
99+
100+
it("can clone with filesystem", function() {
101+
var prefix = process.platform === "win32" ? "" : "file://";
102+
var url = prefix + local("../repos/empty");
103+
104+
return Clone.clone(url, file).then(function(repository) {
105+
assert.ok(repository instanceof Repository);
106+
});
107+
});
108+
});

0 commit comments

Comments
 (0)