| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0322cae commit a06da32
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,20 @@ | |||
| 1 | 1 | var NodeGit = require("../"); | |
| 2 | + var normalizeOptions = require("./util/normalize_options"); | ||
| 2 | 3 | ||
| 3 | 4 | var Checkout = NodeGit.Checkout; | |
| 5 | + var head = Checkout.head; | ||
| 6 | + | ||
| 7 | + /** | ||
| 8 | + * Patch head checkout to automatically coerce objects. | ||
| 9 | + * | ||
| 10 | + * @param repo | ||
| 11 | + * @param options | ||
| 12 | + */ | ||
| 13 | + Checkout.head = function(url, options) { | ||
| 14 | + options = normalizeOptions(options, NodeGit.CheckoutOptions); | ||
| 15 | + | ||
| 16 | + return head.call(this, url, options); | ||
| 17 | + }; | ||
| 18 | + | ||
| 4 | 19 | ||
| 5 | 20 | module.exports = Checkout; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ describe("Checkout", function() { | |||
| 19 | 19 | it("can checkout the head", function() { | |
| 20 | 20 | var repo = this.repo; | |
| 21 | 21 | ||
| 22 | - Checkout.head(repo) | ||
| 22 | + return Checkout.head(repo) | ||
| 23 | 23 | .then(function() { | |
| 24 | 24 | return repo.getBlob(packageJsonOid); | |
| 25 | 25 | }) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments