Permalink
Browse files

Merge pull request #207 from nodegit/checkout-methods

Added new methods in checkout and repository
  • Loading branch information...
2 parents b8a94ae + 95f6951 commit c82fb078a192ea221c9f1093c64321c60d64aa0d @tbranyen tbranyen committed Jul 19, 2014
Showing with 206 additions and 35 deletions.
  1. +62 −1 generate/descriptor.json
  2. +6 −0 generate/setup.js
  3. +101 −22 generate/types.json
  4. +5 −0 lib/checkout.js
  5. +17 −12 lib/nodegit.js
  6. +15 −0 test/tests/checkout.js
View
63 generate/descriptor.json
@@ -92,7 +92,40 @@
},
"checkout": {
- "cType": null
+ "cType": null,
+
+ "dependencies": [
+ "../include/functions/copy.h",
+ "../include/checkout.h",
+ "../include/checkout_options.h",
+ "../include/repository.h",
+ "../include/index.h",
+ "../include/object.h"
+ ],
+
+ "functions": {
+ "git_checkout_head": {
+ "ignore": false
+ },
+
+ "git_checkout_index": {
+ "ignore": false
+ },
+
+ "git_checkout_tree": {
+ "ignore": false
+ },
+
+ "git_checkout_init_options": {
+ "ignore": false
+ }
+ }
+ },
+
+ "checkout_options": {
+ "isStruct": true,
+ "cType": "git_checkout_options",
+ "fields": []
},
"clone": {
@@ -595,6 +628,18 @@
},
"repository": {
+ "dependencies": [
+ "../include/functions/copy.h",
+ "../include/repository.h",
+ "../include/repository.h",
+ "../include/odb.h",
+ "../include/config.h",
+ "../include/refdb.h",
+ "../include/index.h",
+ "../include/oid.h",
+ "../include/repository_init_options.h"
+ ],
+
"functions": {
"git_repository_open": {
"isConstructorMethod": true,
@@ -608,10 +653,26 @@
"git_repository_init": {
"isConstructorMethod": true,
"ignore": false
+ },
+
+ "git_repository_init_ext": {
+ "isConstructorMethod": true,
+ "ignore": false
+ },
+
+ "git_repository_init_init_options": {
+ "ignore": false,
+ "isConstructorMethod": true
}
}
},
+ "repository_init_options": {
+ "isStruct": true,
+ "cType": "git_repository_init_options",
+ "fields": []
+ },
+
"reset": {
"cType": null
},
View
6 generate/setup.js
@@ -42,6 +42,12 @@ typeMap.__proto__ = {
"git_filter_check_fn": { cpp: "Function", js: "Function" },
"git_filter_apply_fn": { cpp: "Function", js: "Function" },
"git_filter_cleanup_fn": { cpp: "Function", js: "Function" },
+ "const git_checkout_options *": { cpp: "GitCheckoutOptions", js: "CheckoutOptions" },
+ "git_checkout_notify_cb": { cpp: "Function", js: "Function" },
+ "git_checkout_progress_cb": { cpp: "Function", js: "Function" },
+ "git_cherry_pick_options *": { cpp: "GitCherryPickOptions", js: "CherryPickOptions" },
+ "const git_cherry_pick_options *": { cpp: "GitCherryPickOptions", js: "CherryPickOptions" },
+ "const git_merge_options *": { cpp: "GitMergeOptions", js: "MergeOptions" }
};
var files = [];
View
123 generate/types.json
@@ -168,24 +168,24 @@
"js": "branchRemoteName"
},
"git_checkout_head": {
- "cpp": "CheckoutHead",
- "js": "checkoutHead"
+ "cpp": "Head",
+ "js": "head"
},
"git_checkout_opts *": {
"js": "CheckoutOpts",
"cpp": "CheckoutOpts"
},
"git_checkout_index": {
- "cpp": "CheckoutIndex",
- "js": "checkoutIndex"
+ "cpp": "Index",
+ "js": "index"
},
"git_index *": {
"cpp": "GitIndex",
"js": "Index"
},
"git_checkout_tree": {
- "cpp": "CheckoutTree",
- "js": "checkoutTree"
+ "cpp": "Tree",
+ "js": "tree"
},
"const git_object *": {
"cpp": "GitObject",
@@ -1733,8 +1733,8 @@
"js": "initExt"
},
"git_repository_init_options *": {
- "js": "RepositoryInitOptions",
- "cpp": "RepositoryInitOptions"
+ "cpp": "GitRepositoryInitOptions",
+ "js": "RepositoryInitOptions"
},
"git_repository_head": {
"cpp": "Head",
@@ -3081,28 +3081,28 @@
"js": "Checkout"
},
"git_checkout_head *": {
- "cpp": "CheckoutHead",
- "js": "checkoutHead"
+ "cpp": "Head",
+ "js": "head"
},
"const git_checkout_head *": {
- "cpp": "CheckoutHead",
- "js": "checkoutHead"
+ "cpp": "Head",
+ "js": "head"
},
"git_checkout_index *": {
- "cpp": "CheckoutIndex",
- "js": "checkoutIndex"
+ "cpp": "Index",
+ "js": "index"
},
"const git_checkout_index *": {
- "cpp": "CheckoutIndex",
- "js": "checkoutIndex"
+ "cpp": "Index",
+ "js": "index"
},
"git_checkout_tree *": {
- "cpp": "CheckoutTree",
- "js": "checkoutTree"
+ "cpp": "Tree",
+ "js": "tree"
},
"const git_checkout_tree *": {
- "cpp": "CheckoutTree",
- "js": "checkoutTree"
+ "cpp": "Tree",
+ "js": "tree"
},
"git_clone **": {
"cpp": "GitClone",
@@ -3365,7 +3365,6 @@
"js": "Config"
},
"const git_config **": {
- "cpp": "GitConfig",
"js": "Config"
},
"git_config_find_global *": {
@@ -9067,5 +9066,85 @@
"const git_remote_delete *": {
"cpp": "Delete",
"js": "delete"
+ },
+ "git_checkout_options": {
+ "cpp": "GitCheckoutOptions",
+ "js": "CheckoutOptions"
+ },
+ "git_checkout_options **": {
+ "cpp": "GitCheckoutOptions",
+ "js": "CheckoutOptions"
+ },
+ "git_checkout_options *": {
+ "cpp": "GitCheckoutOptions",
+ "js": "CheckoutOptions"
+ },
+ "const git_checkout_options **": {
+ "cpp": "GitCheckoutOptions",
+ "js": "CheckoutOptions"
+ },
+ "const git_checkout_options *": {
+ "cpp": "GitCheckoutOptions",
+ "js": "CheckoutOptions"
+ },
+ "git_cherry": {
+ "cpp": "GitCherry",
+ "js": "Cherry"
+ },
+ "git_cherry **": {
+ "cpp": "GitCherry",
+ "js": "Cherry"
+ },
+ "git_cherry *": {
+ "cpp": "GitCherry",
+ "js": "Cherry"
+ },
+ "const git_cherry **": {
+ "cpp": "GitCherry",
+ "js": "Cherry"
+ },
+ "const git_cherry *": {
+ "cpp": "GitCherry",
+ "js": "Cherry"
+ },
+ "git_checkout_init_options": {
+ "cpp": "InitOptions",
+ "js": "initOptions"
+ },
+ "git_checkout_init_options *": {
+ "cpp": "InitOptions",
+ "js": "initOptions"
+ },
+ "const git_checkout_init_options *": {
+ "cpp": "InitOptions",
+ "js": "initOptions"
+ },
+ "git_repository_init_options": {
+ "cpp": "GitRepositoryInitOptions",
+ "js": "RepositoryInitOptions"
+ },
+ "git_repository_init_options **": {
+ "cpp": "GitRepositoryInitOptions",
+ "js": "RepositoryInitOptions"
+ },
+ "const git_repository_init_options **": {
+ "cpp": "GitRepositoryInitOptions",
+ "js": "RepositoryInitOptions"
+ },
+ "const git_repository_init_options *": {
+ "cpp": "GitRepositoryInitOptions",
+ "js": "RepositoryInitOptions"
+ },
+ "git_repository_init_init_options": {
+ "cpp": "InitInitOptions",
+ "js": "initInitOptions"
+ },
+ "git_repository_init_init_options *": {
+ "cpp": "InitInitOptions",
+ "js": "initInitOptions"
+ },
+ "const git_repository_init_init_options *": {
+ "cpp": "InitInitOptions",
+ "js": "initInitOptions"
}
-}
+}
View
5 lib/checkout.js
@@ -0,0 +1,5 @@
+var NodeGit = require("../");
+
+var Checkout = NodeGit.Checkout;
+
+module.exports = Checkout;
View
29 lib/nodegit.js
@@ -39,18 +39,23 @@ descriptors.forEach(function(descriptor) {
exports.__proto__ = rawApi;
// Import extensions
-require("./commit.js");
-require("./diff.js");
-require("./blob.js");
-require("./object.js");
-require("./signature.js");
-require("./odb.js");
-require("./oid.js");
-require("./index.js");
-require("./repository.js");
-require("./refs.js");
-require("./revwalk.js");
-require("./tree.js");
+require("./attr");
+require("./blob");
+require("./checkout");
+require("./commit");
+require("./diff");
+require("./index");
+require("./object");
+require("./odb");
+require("./oid");
+require("./patch");
+require("./refs");
+require("./remote");
+require("./repository");
+require("./revwalk");
+require("./signature");
+require("./tree");
+require("./tree_entry");
// Wrap asynchronous methods to return promises.
promisify(exports);
View
15 test/tests/checkout.js
@@ -0,0 +1,15 @@
+var path = require("path");
+
+describe("Checkout", function() {
+ var reposPath = path.resolve("test/repos/workdir/.git");
+
+ var Repository = require("../../lib/repository");
+
+ before(function() {
+ var test = this;
+
+ return Repository.open(reposPath).then(function(repository) {
+ test.repository = repository;
+ });
+ });
+});

0 comments on commit c82fb07

Please sign in to comment.