Skip to content

Commit f6d299f

Browse files
committed
Revert changes to invalid credentials test
1 parent 1422027 commit f6d299f

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

test/tests/remote.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,21 @@ describe("Remote", function() {
249249
.then(function(remote) {
250250
var ref = "refs/heads/" + branch;
251251
var refs = [ref + ":" + ref];
252+
var firstPass = true;
252253
var options = {
253254
callbacks: {
254-
credentials: function(url, userName, allowedTypes) {},
255+
credentials: function(url, userName) {
256+
if (firstPass) {
257+
firstPass = false;
258+
if (url.indexOf("https") === -1) {
259+
return NodeGit.Cred.sshKeyFromAgent(userName);
260+
} else {
261+
return NodeGit.Cred.userpassPlaintextNew(userName, "");
262+
}
263+
} else {
264+
return NodeGit.Cred.defaultNew();
265+
}
266+
},
255267
certificateCheck: function() {
256268
return 1;
257269
}

0 commit comments

Comments
 (0)