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)


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