Permalink
Browse files

Add git_attr methods and ensure prototype exists

  • Loading branch information...
1 parent 9baa645 commit 568e66492469937ee2dfdb355b1653f88aad6959 @tbranyen tbranyen committed Jul 13, 2014
Showing with 32 additions and 2 deletions.
  1. +26 −1 generate/descriptor.json
  2. +5 −0 lib/attr.js
  3. +1 −1 lib/nodegit.js
  4. 0 test/tests/attr.js
View
@@ -1,6 +1,31 @@
{
"attr": {
- "cType": null
+ "cType": null,
+
+ "functions": {
+ "git_attr_get": {
+ "ignore": false
+ },
+
+ "git_attr_get_many": {
+ "ignore": false
+ },
+
+ "git_attr_foreach": {
+ "ignore": true,
+ "return": {
+ "isErrorCode": true
+ }
+ },
+
+ "git_attr_cache_flush": {
+ "ignore": false
+ },
+
+ "git_attr_add_macro": {
+ "ignore": false
+ }
+ }
},
"blame": {
View
@@ -0,0 +1,5 @@
+var NodeGit = require("../");
+
+var Attr = NodeGit.Attr;
+
+module.exports = Attr;
View
@@ -24,7 +24,7 @@ descriptors.forEach(function(descriptor) {
var original = null;
// Special case when you have a prototype method.
- if (asyncFunc.isPrototypeMethod) {
+ if (asyncFunc.isPrototypeMethod && Ctor.prototype) {
original = Ctor.prototype[asyncFunc.jsFunctionName];
Ctor.prototype[asyncFunc.jsFunctionName] = promisify(original);
}
View
No changes.

0 comments on commit 568e664

Please sign in to comment.