Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/checkout.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
var NodeGit = require("../");
var normalizeOptions = require("./util/normalize_options");

var Checkout = NodeGit.Checkout;
var head = Checkout.head;

/**
* Patch head checkout to automatically coerce objects.
*
* @param repo
* @param options
*/
Checkout.head = function(url, options) {
options = normalizeOptions(options, NodeGit.CheckoutOptions);

return head.call(this, url, options);
};


module.exports = Checkout;
2 changes: 1 addition & 1 deletion test/tests/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("Checkout", function() {
it("can checkout the head", function() {
var repo = this.repo;

Checkout.head(repo)
return Checkout.head(repo)
.then(function() {
return repo.getBlob(packageJsonOid);
})
Expand Down