File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ var fileContent = "hello world";
1010var repoDir = "../../newRepo" ;
1111
1212var repository ;
13+ var remote ;
1314
1415var signature = nodegit . Signature . create ( "Foo bar" ,
1516 "foo@bar.com" , 123456789 , 60 ) ;
@@ -47,15 +48,18 @@ fse.remove(path.resolve(__dirname, repoDir))
4748. then ( function ( ) {
4849 return nodegit . Remote . create ( repository , "origin" ,
4950 "git@github.com:nodegit/push-example.git" )
50- . then ( function ( remote ) {
51- remote . connect ( nodegit . Enums . DIRECTION . PUSH ) ;
51+ . then ( function ( remoteResult ) {
52+ remote = remoteResult ;
5253
5354 remote . setCallbacks ( {
5455 credentials : function ( url , userName ) {
5556 return nodegit . Cred . sshKeyFromAgent ( userName ) ;
5657 }
5758 } ) ;
5859
60+ return remote . connect ( nodegit . Enums . DIRECTION . PUSH ) ;
61+ } )
62+ . then ( function ( ) {
5963 // Create the push object for this remote
6064 return remote . push (
6165 [ "refs/heads/master:refs/heads/master" ] ,
You can’t perform that action at this time.
0 commit comments