Skip to content

Commit 8cca9b4

Browse files
cbargrenJohn Haley
authored andcommitted
Fixing checkout test
1 parent e4e495f commit 8cca9b4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/checkout.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var _tree = Checkout.tree;
1515
* @return {Void} checkout complete
1616
*/
1717
Checkout.head = function(url, options) {
18-
options = normalizeOptions(options, NodeGit.CheckoutOptions);
18+
options = normalizeOptions(options || {}, NodeGit.CheckoutOptions);
1919

2020
return _head.call(this, url, options);
2121
};
@@ -30,7 +30,7 @@ Checkout.head = function(url, options) {
3030
* @return {Void} checkout complete
3131
*/
3232
Checkout.index = function(repo, index, options) {
33-
options = normalizeOptions(options, NodeGit.CheckoutOptions);
33+
options = normalizeOptions(options || {}, NodeGit.CheckoutOptions);
3434

3535
return _index.call(this, repo, index, options);
3636
};
@@ -45,7 +45,7 @@ Checkout.index = function(repo, index, options) {
4545
* @return {Void} checkout complete
4646
*/
4747
Checkout.tree = function(repo, treeish, options) {
48-
options = normalizeOptions(options, NodeGit.CheckoutOptions);
48+
options = normalizeOptions(options || {}, NodeGit.CheckoutOptions);
4949

5050
return _tree.call(this, repo, treeish, options);
5151
};

test/tests/checkout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe("Checkout", function() {
7575
var test = this;
7676

7777
return test.repository.getTagByName("annotated-tag").then(function(tag) {
78-
return Checkout.tree(test.repository, test.tag);
78+
return Checkout.tree(test.repository, tag);
7979
}).then(function() {
8080
return test.repository.getHeadCommit();
8181
}).then(function(commit) {

0 commit comments

Comments
 (0)