var NodeGit = require("../");
var normalizeOptions = NodeGit.Utils.normalizeOptions;

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

/**
* Patch head checkout to automatically coerce objects.
*
* @async
* @param {Repository} repo The repo to checkout head
* @param {CheckoutOptions} [options] Options for the checkout
* @return {Void} checkout complete
*/
Checkout.head = function(url, options) {
  options = normalizeOptions(options, NodeGit.CheckoutOptions);

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

/**
* Patch tree checkout to automatically coerce objects.
*
* @async
* @param {Repository} repo
* @param {Oid|Tree|Commit|Reference} treeish
* @param {CheckoutOptions} [options]
* @return {Void} checkout complete
*/
Checkout.tree = function(repo, treeish, options) {
  options = normalizeOptions(options, NodeGit.CheckoutOptions);

  return tree.call(this, repo, treeish, options);
};

@@ -116,16 +116,17 @@
 ut;%0Avar 
+_
 head = C
@@ -143,16 +143,46 @@
 ad;%0Avar 
+_index = Checkout.index;%0Avar _
 tree = C
@@ -534,16 +534,17 @@
  return 
+_
 head.cal
@@ -570,16 +570,452 @@
 s);%0A%7D;%0A%0A
+/**%0A* Patch index checkout to automatically coerce objects.%0A*%0A* @async%0A* @param %7BRepository%7D repo The repo to checkout an index%0A* @param %7BIndex%7D The index to checkout%0A* @param %7BCheckoutOptions%7D %5Boptions%5D Options for the checkout%0A* @return %7BVoid%7D checkout complete%0A*/%0ACheckout.index = function(repo, index, options) %7B%0A  options = normalizeOptions(options, NodeGit.CheckoutOptions);%0A%0A  return _index.call(this, repo, index, options);%0A%7D;%0A%0A
 /**%0A* Pa
@@ -1331,32 +1331,32 @@
 ckoutOptions);%0A%0A
-
   return tree.ca
@@ -1348,16 +1348,17 @@
  return 
+_
 tree.cal

normalize options for Checkout.index