File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed
Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 182182 }
183183 }
184184 },
185+ "checkout" : {
186+ "functions" : {
187+ "git_checkout_head" : {
188+ "args" : {
189+ "opts" : {
190+ "isOptional" : true
191+ }
192+ },
193+ "isAsync" : true ,
194+ "return" : {
195+ "isErrorCode" : true
196+ }
197+ },
198+ "git_checkout_index" : {
199+ "ignore" : true
200+ },
201+ "git_checkout_tree" : {
202+ "ignore" : true
203+ }
204+ }
205+ },
185206 "clone" : {
186207 "functions" : {
187208 "git_clone" : {
Original file line number Diff line number Diff line change 1+ var assert = require ( "assert" ) ;
12var path = require ( "path" ) ;
23
34describe ( "Checkout" , function ( ) {
5+ var packageJsonOid = "0fa56e90e096a4c24c785206b826ab914ea3de1e" ;
46 var reposPath = path . resolve ( "test/repos/workdir/.git" ) ;
57
68 var Repository = require ( "../../lib/repository" ) ;
9+ var Checkout = require ( "../../lib/checkout" ) ;
710
811 before ( function ( ) {
912 var test = this ;
1013
11- return Repository . open ( reposPath ) . then ( function ( repository ) {
12- test . repository = repository ;
14+ return Repository . open ( reposPath ) . then ( function ( repo ) {
15+ test . repo = repo ;
16+ } ) ;
17+ } ) ;
18+
19+ it ( "can checkout the head" , function ( ) {
20+ var repo = this . repo ;
21+
22+ Checkout . head ( repo )
23+ . then ( function ( ) {
24+ return repo . getBlob ( packageJsonOid ) ;
25+ } )
26+ . then ( function ( blob ) {
27+ var packageJson = blob . toString ( ) ;
28+
29+ assert . ok ( ~ packageJson . indexOf ( "\"ejs\": \"~1.0.0\"," ) ) ;
1330 } ) ;
1431 } ) ;
1532} ) ;
You can’t perform that action at this time.
0 commit comments