1

I'm trying to use the Nodegit plugin to clone some git repos into a directory called 'tmp' so I can do things with the actual folder (upload it to a server). Here's my code:

var git = require('nodegit'); var repos = [some https repo urls] var options = { remoteCallbacks: { certificateCheck: function() { return 1; } } }; for(i = 0; i<repos.length; i++){ git.Clone(repos[i], './tmp', options).catch(function(err) { console.error(err); } ); } 

All it does is create an empty directory called 'tmp' for a split second and deletes it. The errors I get are ./tmp' exists and is not an empty directory (but it does not exist?) and authentication required but no callback set. Anyone know how to fix these?

2
  • I haven't used the project, but looking at the docs NodeGit seems to support promises, so add an error case handler with something like git.Clone(repos[i], './tmp).catch(function(err) { console.log(err); } ); to see what's going wrong. Commented Apr 6, 2015 at 21:00
  • Thanks @orbitbot. I added the error case and updated the op with the errors. Commented Apr 6, 2015 at 21:43

1 Answer 1

1

As @johnhaley81 mentioned in gitter, you should checkout the test code here. Overriding the certificateCheck should resolve The SSL certificate is invalid error.

The ./tmp error makes sense, because you are trying to clone multiple repositories into the same directory.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.