forked from AndreyG/libgit2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreference.cpp
More file actions
40 lines (32 loc) · 758 Bytes
/
Copy pathreference.cpp
File metadata and controls
40 lines (32 loc) · 758 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
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "git2cpp/reference.h"
#include <git2/refs.h>
#include <cassert>
#include <utility>
namespace git
{
void Reference::Destroy::operator()(git_reference* ref) const
{
git_reference_free(ref);
}
Reference::Reference(git_reference * ref)
: ref_(ref)
{
}
const char * Reference::name() const
{
return git_reference_name(ptr());
}
git_ref_t Reference::type() const
{
return git_reference_type(ptr());
}
git_oid const & Reference::target() const
{
assert(type() != GIT_REF_SYMBOLIC);
return *git_reference_target(ptr());
}
const char * Reference::symbolic_target() const
{
return git_reference_symbolic_target(ptr());
}
}