File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 178178 "ignore" : true
179179 },
180180 "git_branch_set_upstream" : {
181- "isAsync" : false ,
181+ "isAsync" : true ,
182182 "args" : {
183183 "upstream_name" : {
184184 "isOptional" : true
185185 }
186+ },
187+ "return" : {
188+ "isReturn" : true ,
189+ "isErrorCode" : true
186190 }
187191 },
188192 "git_branch_upstream" : {
189- "isAsync" : false ,
193+ "isAsync" : true ,
190194 "return" : {
195+ "isReturn" : true ,
191196 "isErrorCode" : true
192197 }
193198 }
Original file line number Diff line number Diff line change @@ -289,13 +289,10 @@ var Helpers = {
289289 // available
290290 if ( key == typeDef . cType + "_free" ) {
291291 typeDef . freeFunctionName = key ;
292- //fnDef.ignore = true;
293- //return;
294292 }
295293
296294 fnDef . cppFunctionName = Helpers . cTypeToCppName ( key , "git_" + typeDef . typeName ) ;
297295 fnDef . jsFunctionName = Helpers . cTypeToJsName ( key , "git_" + typeDef . typeName ) ;
298- //fnDef.isAsync = false; // until proven otherwise
299296
300297 if ( fnDef . cppFunctionName == typeDef . cppClassName ) {
301298 fnDef . cppFunctionName = fnDef . cppFunctionName . replace ( "Git" , "" ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ describe("Branch", function() {
99 var Branch = NodeGit . Branch ;
1010 var branchName = "test-branch" ;
1111 var fullBranchName = "refs/heads/" + branchName ;
12+ var upstreamName = "origin/master" ;
1213
1314 var reposPath = local ( "../repos/workdir" ) ;
1415
@@ -56,4 +57,16 @@ describe("Branch", function() {
5657 assert . ok ( branch . isHead ( ) ) ;
5758 } ) ;
5859 } ) ;
60+
61+ it ( "can set an upstream for a branch" , function ( ) {
62+ var branch = this . branch ;
63+
64+ return NodeGit . Branch . setUpstream ( branch , upstreamName )
65+ . then ( function ( ) {
66+ return NodeGit . Branch . upstream ( branch ) ;
67+ } )
68+ . then ( function ( upstream ) {
69+ assert . equal ( upstream . shorthand ( ) , upstreamName ) ;
70+ } ) ;
71+ } ) ;
5972} ) ;
You can’t perform that action at this time.
0 commit comments