git2wrap

C++20 wrapper for libgit2
git clone git://git.dimitrijedobrota.com/git2wrap.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |

oid.cpp (365B)


1 #include "git2wrap/oid.hpp" 2 3 namespace git2wrap 4 { 5 6 oid::oid(const git_oid* objid) 7 : m_oid(const_cast<git_oid*>(objid), empty_lambda) // NOLINT 8 { 9 } 10 11 std::string oid::get_hex_string(size_t n) 12 { 13 std::string str(n, 0); 14 char* bfr = const_cast<char*>(str.c_str()); // NOLINT 15 16 git_oid_tostr(bfr, n + 1, m_oid.get()); 17 18 return str; 19 } 20 21 } // namespace git2wrap