Closed Xrayez closed 2 years ago
Great to see it's working!
One thing that I want to point out is that I saw that you left out the smart ptr wrappers over libgit2 from the headers. I hope you are aware that this will make you leak memory whenever any libgit2 function fails. Just an FYI.
One thing that I want to point out is that I saw that you left out the smart ptr wrappers over libgit2 from the headers.
I'm not sure whether it was there in the first place. But yeah, I'll have to take a closer look.
Yeah, you can look at these specifically https://github.com/godotengine/godot-git-plugin/blob/master/godot-git-plugin/src/git_api.h#L88
You would also need the Capture
template from the same file if you shift to the smart ptrs. This template will ensure that the functions that take in double ptrs handle the internal object destruction properly in case of any failure.
It certainly looks weird but it streamlines working with libgit2 in C++ if you don't want to depend on using goto's to do cleanup.
Turns out I switched to a wrong branch of godot-git-plugin
. 🤦
Yeah, I see it now. 😃
Unfortunately, I haven't got enough motivation to work on this (#191), but the "Stage All" → "Commit" seems to work as before with new API. Consider this feature to be regressed in relation to 2.0 version, if someone would like to work on this, you can do so by looking up the master
branch of godotengine/godot-git-plugin.
Just restoring current functionality. Push/pull may be implemented later.
Code updates adapted from godotengine/godot-git-plugin#84. Thanks @ChronicallySerious for ensuring that the API is possible to use via C++ modules (needed for Goost).