taskolib / libgit4cpp

C++ wrapper for libgit2 with limited functionality
https://taskolib.github.io/libgit4cpp/
GNU Lesser General Public License v2.1
1 stars 0 forks source link

Implement checkout wrapper with parameter for partial checkout #23

Closed wyrnat closed 1 month ago

wyrnat commented 3 months ago

[why] This implementation serves as a preparation to exchange sequences between VXFEL and XFEL repository.

[what] A git_checkout_options instance is created and the path specifier is implemented within. I used C type conversion for std::string to gitstrarray, probably there is a better way to do this. To receive the latest commit of said branch, the function checkout assumes that within repo variable, there is already the branch we want to checkout from. If not, the Error handling is done already in the function get_commit. After we retrieved the branch, we collect the whole tree to be able to use the libgit2 function git_checkout_tree. For this, it was necessary to create a wrapper for git_commit_tree

[next] I will also implement tests for this. I decided to already open a pull request so that you can "add your mustard" as soon as possible. And documentation of the code...

alt-graph commented 1 month ago

@wyrnat: I'll merge this as-is so that I can build a new version. Thanks for the PR!