File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 16021602 }
16031603 },
16041604 "git_remote_default_branch" : {
1605- "ignore" : true
1605+ "isAsync" : true ,
1606+ "args" : {
1607+ "out" : {
1608+ "isReturn" : true
1609+ },
1610+ "remote" : {
1611+ "isSelf" : true
1612+ }
1613+ },
1614+ "return" : {
1615+ "isErrorCode" : true
1616+ }
16061617 },
16071618 "git_remote_delete" : {
16081619 "isAsync" : true ,
Original file line number Diff line number Diff line change @@ -150,6 +150,22 @@ describe("Remote", function() {
150150 } ) ;
151151 } ) ;
152152
153+ it ( "can get the default branch of a remote" , function ( ) {
154+ var remoteCallbacks = {
155+ certificateCheck : function ( ) {
156+ return 1 ;
157+ }
158+ } ;
159+
160+ var remote = this . remote ;
161+
162+ return remote . connect ( NodeGit . Enums . DIRECTION . FETCH , remoteCallbacks )
163+ . then ( function ( ) { return remote . defaultBranch ( ) ; } )
164+ . then ( function ( branchName ) {
165+ assert . equal ( "refs/heads/master" , branchName ) ;
166+ } ) ;
167+ } ) ;
168+
153169 it ( "can fetch from a remote" , function ( ) {
154170 return this . repository . fetch ( "origin" , {
155171 callbacks : {
You can’t perform that action at this time.
0 commit comments