Commit 19e24053 authored by Remy Suen's avatar Remy Suen

Add JavaScript version of `git_tag_peel()`

The git_tag_peel() function from libgit2 naturally takes a pointer as
a parameter for providing the caller with the peeled object. However,
this kind of API does not make sense in the JavaScript world so we
need to change the generated code to return the actual object to the
caller.
parent 4611ca75
...@@ -2696,6 +2696,14 @@ ...@@ -2696,6 +2696,14 @@
"isErrorCode": true "isErrorCode": true
}, },
"isAsync": true "isAsync": true
},
"git_tag_peel": {
"args": {
"tag_target_out": {
"isReturn": true
}
},
"isAsync": true
} }
} }
}, },
......
...@@ -220,4 +220,14 @@ describe("Tag", function() { ...@@ -220,4 +220,14 @@ describe("Tag", function() {
assert(object.type(), Obj.TYPE.TAG); assert(object.type(), Obj.TYPE.TAG);
}); });
}); });
it("can peel a tag", function() {
return this.repository.getTagByName(tagName)
.then(function(tag) {
return tag.peel();
})
.then(function(object) {
assert.equal(object.isCommit(), true);
});
});
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment