Skip to content

Commit 80ec4b3

Browse files
John Haleyorderedlist
authored andcommitted
Fix pointer calculation with embedded libgit2 objects
1 parent aa88424 commit 80ec4b3

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

generate/templates/partials/fields.cc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,19 @@
77
{% if field | isFixedLengthString %}
88
char* {{ field.name }} = (char *)ObjectWrap::Unwrap<{{ cppClassName }}>(args.This())->GetValue()->{{ field.name }};
99
{% else %}
10-
{{ field.cType }} {% if not field.cppClassName|isV8Value %}*{% endif %}{{ field.name }} =
11-
{% if not field.cppClassName|isV8Value %}&{% endif %}ObjectWrap::Unwrap<{{ cppClassName }}>(args.This())->GetValue()->{{ field.name }};
10+
{{ field.cType }}
11+
{% if not field.cppClassName|isV8Value %}
12+
{% if not field.cType|isPointer %}
13+
*
14+
{% endif %}
15+
{% endif %}
16+
{{ field.name }} =
17+
{% if not field.cppClassName|isV8Value %}
18+
{% if not field.cType|isPointer %}
19+
&
20+
{% endif %}
21+
{% endif %}
22+
ObjectWrap::Unwrap<{{ cppClassName }}>(args.This())->GetValue()->{{ field.name }};
1223
{% endif %}
1324

1425
{% partial convertToV8 field %}

test/tests/status_list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var exec = promisify(function(command, opts, callback) {
88
return require("child_process").exec(command, opts, callback);
99
});
1010

11-
describe.only("StatusList", function() {
11+
describe("StatusList", function() {
1212
var Status = require(local("../../lib/status"));
1313
var StatusList = require(local("../../lib/status_list"));
1414
var Repository = require(local("../../lib/repository"));

0 commit comments

Comments
 (0)