Skip to content

Commit a373d92

Browse files
committed
Convert Buf.prototype.set and Buf.prototype.grow to sync methods
1 parent 3695fda commit a373d92

2 files changed

Lines changed: 20 additions & 38 deletions

File tree

generate/input/descriptor.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
"jsClassName": "Number",
402402
"isErrorCode": true
403403
},
404-
"isAsync": true
404+
"isAsync": false
405405
},
406406
"git_buf_set": {
407407
"cppFunctionName": "Set",
@@ -422,7 +422,7 @@
422422
"jsClassName": "Number",
423423
"isErrorCode": true
424424
},
425-
"isAsync": true
425+
"isAsync": false
426426
}
427427
},
428428
"dependencies": [

test/tests/filter.js

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,8 @@ describe("Filter", function() {
476476

477477
return Registry.register(filterName, {
478478
apply: function(to, from, source) {
479-
return to.set(tempBuffer, length)
480-
.then(function() {
481-
return NodeGit.Error.CODE.PASSTHROUGH;
482-
});
479+
to.set(tempBuffer, length);
480+
return NodeGit.Error.CODE.PASSTHROUGH;
483481
},
484482
check: function() {
485483
return NodeGit.Error.CODE.OK;
@@ -522,10 +520,8 @@ describe("Filter", function() {
522520

523521
return Registry.register(filterName, {
524522
apply: function(to, from, source) {
525-
return to.set(tempBuffer, length)
526-
.then(function() {
527-
return NodeGit.Error.CODE.OK;
528-
});
523+
to.set(tempBuffer, length);
524+
return NodeGit.Error.CODE.OK;
529525
},
530526
check: function(src, attr) {
531527
return NodeGit.Error.CODE.OK;
@@ -568,10 +564,8 @@ describe("Filter", function() {
568564

569565
return Registry.register(filterName, {
570566
apply: function(to, from, source) {
571-
return to.set(largeBuffer, largeBufferSize)
572-
.then(function() {
573-
return NodeGit.Error.CODE.OK;
574-
});
567+
to.set(largeBuffer, largeBufferSize);
568+
return NodeGit.Error.CODE.OK;
575569
},
576570
check: function(src, attr) {
577571
return NodeGit.Error.CODE.OK;
@@ -626,10 +620,8 @@ describe("Filter", function() {
626620

627621
return Registry.register(filterName, {
628622
apply: function(to, from, source) {
629-
return to.set(tempBuffer, length)
630-
.then(function() {
631-
return NodeGit.Error.CODE.OK;
632-
});
623+
to.set(tempBuffer, length);
624+
return NodeGit.Error.CODE.OK;
633625
},
634626
check: function(src, attr) {
635627
return NodeGit.Error.CODE.OK;
@@ -668,10 +660,8 @@ describe("Filter", function() {
668660

669661
return Registry.register(filterName, {
670662
apply: function(to, from, source) {
671-
return to.set(tempBuffer, length)
672-
.then(function() {
673-
return NodeGit.Error.CODE.OK;
674-
});
663+
to.set(tempBuffer, length);
664+
return NodeGit.Error.CODE.OK;
675665
},
676666
check: function(src, attr) {
677667
return src.path() === "README.md" ?
@@ -725,10 +715,8 @@ describe("Filter", function() {
725715

726716
return Registry.register(filterName, {
727717
apply: function(to, from, source) {
728-
return to.set(tempBuffer, length)
729-
.then(function() {
730-
return NodeGit.Error.CODE.OK;
731-
});
718+
to.set(tempBuffer, length);
719+
return NodeGit.Error.CODE.OK;
732720
},
733721
check: function(src, attr) {
734722
return src.path() === "README.md" ?
@@ -956,10 +944,8 @@ describe("Filter", function() {
956944

957945
return Registry.register(filterName, {
958946
apply: function(to, from, source) {
959-
return to.set(tempBuffer, length)
960-
.then(function() {
961-
return NodeGit.Error.CODE.OK;
962-
});
947+
to.set(tempBuffer, length);
948+
return NodeGit.Error.CODE.OK;
963949
},
964950
check: function(src, attr) {
965951
return NodeGit.Error.CODE.OK;
@@ -999,10 +985,8 @@ describe("Filter", function() {
999985

1000986
return Registry.register(filterName, {
1001987
apply: function(to, from, source) {
1002-
return to.set(tempBuffer, length)
1003-
.then(function() {
1004-
return NodeGit.Error.CODE.OK;
1005-
});
988+
to.set(tempBuffer, length);
989+
return NodeGit.Error.CODE.OK;
1006990
},
1007991
check: function(src, attr) {
1008992
return NodeGit.Error.CODE.OK;
@@ -1044,10 +1028,8 @@ describe("Filter", function() {
10441028

10451029
return Registry.register(filterName, {
10461030
apply: function(to, from, source) {
1047-
return to.set(tempBuffer, length)
1048-
.then(function() {
1049-
return NodeGit.Error.CODE.OK;
1050-
});
1031+
to.set(tempBuffer, length);
1032+
return NodeGit.Error.CODE.OK;
10511033
},
10521034
check: function(src, attr) {
10531035
return NodeGit.Error.CODE.OK;

0 commit comments

Comments
 (0)