Skip to content

Commit dd3e8e0

Browse files
committed
make cred-New functions all sync
1 parent 5d371ae commit dd3e8e0

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

generate/input/descriptor.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,20 +364,26 @@
364364
"cred": {
365365
"cType": "git_cred",
366366
"functions": {
367+
"git_cred_default_new": {
368+
"isAsync": false
369+
},
367370
"git_cred_ssh_custom_new": {
368371
"ignore": true
369372
},
370373
"git_cred_ssh_interactive_new": {
371374
"ignore": true
372375
},
373-
"git_cred_ssh_key_from_agent":{
376+
"git_cred_ssh_key_from_agent": {
374377
"isAsync": false
375378
},
376379
"git_cred_ssh_key_new": {
377380
"isAsync": false
378381
},
379382
"git_cred_userpass": {
380383
"ignore": true
384+
},
385+
"git_cred_userpass_plaintext_new": {
386+
"isAsync": false
381387
}
382388
}
383389
},

test/tests/cred.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ describe("Cred", function() {
77
var sshPrivateKey = path.resolve("./id_rsa");
88

99
it("can create default credentials", function() {
10-
NodeGit.Cred.defaultNew().then(function (defaultCreds) {
11-
assert(defaultCreds instanceof NodeGit.Cred);
12-
});
10+
var defaultCreds = NodeGit.Cred.defaultNew();
11+
assert(defaultCreds instanceof NodeGit.Cred);
1312
});
1413

1514
it("can create ssh credentials using passed keys", function() {
@@ -23,9 +22,8 @@ describe("Cred", function() {
2322
});
2423

2524
it("can create credentials using plaintext", function() {
26-
NodeGit.Cred.userpassPlaintextNew("username", "password")
27-
.then(function (plaintextCreds) {
28-
assert(plaintextCreds instanceof NodeGit.Cred);
29-
});
25+
var plaintextCreds = NodeGit.Cred.userpassPlaintextNew
26+
("username", "password");
27+
assert(plaintextCreds instanceof NodeGit.Cred);
3028
});
3129
});

0 commit comments

Comments
 (0)