forked from nodegit/nodegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckout.js
More file actions
35 lines (30 loc) · 931 Bytes
/
checkout.js
File metadata and controls
35 lines (30 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);
};