-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathobject_wrapper.cpp
More file actions
27 lines (22 loc) · 515 Bytes
/
object_wrapper.cpp
File metadata and controls
27 lines (22 loc) · 515 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "../wrapper/object_wrapper.hpp"
object_wrapper::object_wrapper(git_object* obj)
: base_type(obj)
{
}
object_wrapper::~object_wrapper()
{
git_object_free(p_resource);
p_resource = nullptr;
}
const git_oid& object_wrapper::oid() const
{
return *git_object_id(*this);
}
object_wrapper::operator git_commit*() const noexcept
{
return reinterpret_cast<git_commit*>(p_resource);
}
object_wrapper::operator git_tag*() const noexcept
{
return reinterpret_cast<git_tag*>(p_resource);
}