| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6a4afa3 commit 2a87e60
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -182,6 +182,27 @@ | |||
| 182 | 182 | } | |
| 183 | 183 | } | |
| 184 | 184 | }, | |
| 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 | + }, | ||
| 185 | 206 | "clone": { | |
| 186 | 207 | "functions": { | |
| 187 | 208 | "git_clone": { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,15 +1,32 @@ | |||
| 1 | + var assert = require("assert"); | ||
| 1 | 2 | var path = require("path"); | |
| 2 | 3 | ||
| 3 | 4 | describe("Checkout", function() { | |
| 5 | + var packageJsonOid = "0fa56e90e096a4c24c785206b826ab914ea3de1e"; | ||
| 4 | 6 | var reposPath = path.resolve("test/repos/workdir/.git"); | |
| 5 | 7 | ||
| 6 | 8 | var Repository = require("../../lib/repository"); | |
| 9 | + var Checkout = require("../../lib/checkout"); | ||
| 7 | 10 | ||
| 8 | 11 | before(function() { | |
| 9 | 12 | var test = this; | |
| 10 | 13 | ||
| 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\",")); | ||
| 13 | 30 | }); | |
| 14 | 31 | }); | |
| 15 | 32 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments