Skip to content

Commit 568e664

Browse files
committed
Add git_attr methods and ensure prototype exists
1 parent 9baa645 commit 568e664

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

generate/descriptor.json

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
{
22
"attr": {
3-
"cType": null
3+
"cType": null,
4+
5+
"functions": {
6+
"git_attr_get": {
7+
"ignore": false
8+
},
9+
10+
"git_attr_get_many": {
11+
"ignore": false
12+
},
13+
14+
"git_attr_foreach": {
15+
"ignore": true,
16+
"return": {
17+
"isErrorCode": true
18+
}
19+
},
20+
21+
"git_attr_cache_flush": {
22+
"ignore": false
23+
},
24+
25+
"git_attr_add_macro": {
26+
"ignore": false
27+
}
28+
}
429
},
530

631
"blame": {

lib/attr.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var NodeGit = require("../");
2+
3+
var Attr = NodeGit.Attr;
4+
5+
module.exports = Attr;

lib/nodegit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ descriptors.forEach(function(descriptor) {
2424
var original = null;
2525

2626
// Special case when you have a prototype method.
27-
if (asyncFunc.isPrototypeMethod) {
27+
if (asyncFunc.isPrototypeMethod && Ctor.prototype) {
2828
original = Ctor.prototype[asyncFunc.jsFunctionName];
2929
Ctor.prototype[asyncFunc.jsFunctionName] = promisify(original);
3030
}

test/tests/attr.js

Whitespace-only changes.

0 commit comments

Comments
 (0)